Before Swift 5.7
protocol TestProtocol {}
struct A: TestProtocol {}
struct B: TestProtocol {}
func somethings<T: TestProtocol>(source: T) -> TestProtocol {
return source
}
let a = somethings(source: A())
let b = somethings(source: a) // ⛔️ Protocol 'TestProtocol' as a type cannot conform to the protocol itself
Swift 5.7
let a = somethings(source: A())
let b = somethings(source: a) // ✅ OK
why no error?