I'm just curious if its possible to do something like the following
protocol Data { }
class A: Data { }
class B: Data { }
class Generic<T> { }
class doStuff {
func prepareToDoStuff() {
self.doTheStuffWithGenerics([Generic<A>(), Generic<B>])
}
func doTheStuffWithGenerics<T: Generic<Data>>(_ generics: [T]) {
}
}
Currently my compiler is telling me no saying
"cannot convert value of type 'Generic[A]' to expected element type 'Generic[Data]'"
any thoughts? solutions?