How do I add an extension method to a generic typed class, and access the generic type defined on the class to make the method typesafe?
The following method gives a compile error because T is not the same generic type defined on the class.
extension Array {
mutating public func addTwo<T>(object: T) {
append(object)
append(object)
}
}