I am curious if it is possible to test for protocol conformance when the protocol has an associated type. I know you cannot use a protocol as a type when it has an associated type, but it seems the protocol conformance test should work.
protocol Parent {
typealias Child
var children: [Child] { get set }
}
class Foo: Parent {
typealias Child = Int
var children = [Child]()
}
let test = Foo()
if test is Parent {
// error: protocol 'Parent' can only be used as a generic constraint because it has Self or associated type requirements
}