// RUN: %target-parse-verify-swift protocol SomeProtocol { associatedtype T } extension SomeProtocol where T == Optional { } // expected-error{{same-type constraint 'Self.T' == 'Optional' is recursive}} // rdar://problem/20000145 public protocol P { associatedtype T } public struct S> {} // rdar://problem/19840527 class X { // expected-error{{same-type requirement makes generic parameter 'T' non-generic}} var type: T { return self.dynamicType } // expected-error{{cannot convert return expression of type 'X.Type' to return type 'T'}} } protocol Y { associatedtype Z = Z // expected-error{{type alias 'Z' circularly references itself}} }