// RUN: %target-typecheck-verify-swift // RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s // RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures -disable-requirement-machine-reuse 2>&1 | %FileCheck %s // CHECK-LABEL: .NonEmptyProtocol@ // CHECK-NEXT: Requirement signature: public protocol NonEmptyProtocol: Collection where Element == C.Element, Index == C.Index { associatedtype C: Collection } // CHECK-LABEL: .MultiPoint@ // CHECK-NEXT: Requirement signature: public protocol MultiPoint { associatedtype C: CoordinateSystem associatedtype P where Self.P == Self.C.P associatedtype X: NonEmptyProtocol where X.C: NonEmptyProtocol, X.Element == Self.P } // CHECK-LABEL: .CoordinateSystem@ // CHECK-NEXT: Requirement signature: public protocol CoordinateSystem { associatedtype P: Point where Self.P.C == Self associatedtype S: Size where Self.S.C == Self associatedtype L: Line where Self.L.C == Self associatedtype B: BoundingBox where Self.B.C == Self } // CHECK-LABEL: .Line@ // CHECK-NEXT: Requirement signature: public protocol Line: MultiPoint {} // CHECK-LABEL: .Size@ // CHECK-NEXT: Requirement signature: public protocol Size { associatedtype C: CoordinateSystem where Self.C.S == Self } // CHECK-LABEL: .BoundingBox@ // CHECK-NEXT: Requirement signature: public protocol BoundingBox { associatedtype C: CoordinateSystem typealias P = Self.C.P typealias S = Self.C.S } // CHECK-LABEL: .Point@ // CHECK-NEXT: Requirement signature: public protocol Point { associatedtype C: CoordinateSystem where Self.C.P == Self } func sameType(_: T, _: T) {} func conformsToPoint(_: T.Type) {} func testMultiPoint(_: T) { sameType(T.C.P.self, T.X.Element.self) conformsToPoint(T.P.self) } func testCoordinateSystem(_: T) { sameType(T.P.C.self, T.self) }