Files
swift-mirror/test/ModuleInterface/parameterized-protocols.swift
Slava Pestov 9a7df88bc8 ASTPrinter: Rename PrimaryAssociatedTypes feature to PrimaryAssociatedTypes2
There was a window where the PrimaryAssociatedTypes feature guarded the old
syntax; let's make sure we don't see breakage if a new standard library is
used with an old compiler.
2022-04-11 15:27:38 -04:00

21 lines
913 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -typecheck -module-name ParameterizedProtocols -emit-module-interface-path %t/ParameterizedProtocols.swiftinterface %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) && $PrimaryAssociatedTypes2
// 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