I don't know why this happening, I'd like to return a parameter in accordance to MyProtocol with an array, so I'm trying to achieve that the following way:
import Foundation
protocol Test {
}
protocol ArrayTest {
associatedtype E : Test
}
extension Array : ArrayTest where Element:Test{
typealias E = Element
}
class BBB {
func ggg<T:ArrayTest>( kk: ((_ value:T) -> Void)?){
}
}
class AAA<T:ArrayTest> {
func ggg(){
BBB().ggg { (test) in//Generic parameter 'T' could not be inferred
here
}
}
}