// RUN: %swift %s -verify protocol P1 { func p1() } protocol P2 : P1 { func p2() } protocol P3 { func p3() } protocol P4 : P3 { func p4() } typealias Any = protocol<> typealias Any2 = protocol< > func testEquality() { // Remove duplicates from protocol-conformance types. var x1 : (_ : protocol) -> () var x2 : (_ : protocol) -> () x1 = x2 // Singleton protocol-conformance types, after duplication, are the same as // simply naming the protocol type. var x3 : (_ : protocol) -> () var x4 : (_ : P2) -> () x3 = x4 // Empty protocol-conformance types are empty. var x5 : (_ : Any) -> () var x6 : (_ : Any2) -> () x5 = x6 var x7 : (_ : protocol) -> () var x8 : (_ : protocol) -> () x7 = x8 // expected-error{{invalid conversion from type '(_ : protocol) -> ()' to '(_ : protocol) -> ()'}} } typealias Bogus = protocol // expected-error{{non-protocol type 'Int' cannot be used within 'protocol<...>'}}