mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
21 lines
949 B
Swift
21 lines
949 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -typecheck -module-name ParameterizedProtocols -emit-module-interface-path %t/ParameterizedProtocols.swiftinterface -enable-parameterized-protocol-types %s
|
|
// RUN: %FileCheck %s < %t/ParameterizedProtocols.swiftinterface
|
|
|
|
public protocol HasPrimaryAssociatedTypes<T, U> {
|
|
associatedtype T : Collection where T.Element == U
|
|
associatedtype U : Equatable
|
|
}
|
|
|
|
// CHECK: #if compiler(>=5.3) && $PrimaryAssociatedTypes
|
|
// CHECK-NEXT: public protocol HasPrimaryAssociatedTypes<T, U> {
|
|
// CHECK-NEXT: associatedtype T : Swift.Collection
|
|
// CHECK-NEXT: associatedtype U : Swift.Equatable where Self.U == Self.T.Element
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: #else
|
|
// CHECK-NEXT: public protocol HasPrimaryAssociatedTypes {
|
|
// CHECK-NEXT: associatedtype T : Swift.Collection
|
|
// CHECK-NEXT: associatedtype U : Swift.Equatable where Self.U == Self.T.Element
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: #endif
|