Skip to content

Commit 1301759

Browse files
authored
Merge pull request swiftlang#41862 from slavapestov/add-test-sr15979
Add regression test for https://bugs.swift.org/browse/SR-15979
2 parents aa82a85 + 064bce4 commit 1301759

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/type/parameterized_protocol.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %target-typecheck-verify-swift -requirement-machine-protocol-signatures=verify -requirement-machine-inferred-signatures=verify -enable-parameterized-protocol-types -disable-availability-checking
1+
// RUN: %target-typecheck-verify-swift -requirement-machine-protocol-signatures=on -requirement-machine-inferred-signatures=on -enable-parameterized-protocol-types -disable-availability-checking
22

3-
// RUN: not %target-swift-frontend -typecheck %s -debug-generic-signatures -requirement-machine-protocol-signatures=verify -enable-parameterized-protocol-types -requirement-machine-inferred-signatures=verify -disable-availability-checking 2>&1 | %FileCheck %s
3+
// RUN: not %target-swift-frontend -typecheck %s -debug-generic-signatures -requirement-machine-protocol-signatures=on -enable-parameterized-protocol-types -requirement-machine-inferred-signatures=on -disable-availability-checking 2>&1 | %FileCheck %s
44

55

66
/// Test some invalid syntax first
@@ -77,6 +77,13 @@ protocol SequenceWrapperProtocol {
7777
associatedtype E
7878
}
7979

80+
// https://bugs.swift.org/browse/SR-15979 - the GenericSignatureBuilder doesn't like this protocol.
81+
82+
// CHECK-LABEL: .Recursive@
83+
// CHECK-NEXT: Requirement signature: <Self where Self.[Recursive]B == Self.[Recursive]D.[Recursive]B, Self.[Recursive]C == Self.[Recursive]D.[Recursive]C, Self.[Recursive]D : Recursive>
84+
protocol Recursive<B, C> {
85+
associatedtype D: Recursive<B, C> = Self
86+
}
8087

8188
/// Parametrized protocol in where clause of concrete type
8289

@@ -179,6 +186,8 @@ protocol SomeProto {}
179186
func protocolCompositionNotSupported(_: SomeProto & Sequence<Int>) {}
180187
// expected-error@-1 {{non-protocol, non-class type 'Sequence<Int>' cannot be used within a protocol-constrained type}}
181188

189+
/// More regression tests
190+
182191
protocol DoubleWide<X, Y> {
183192
var x: X { get }
184193
var y: Y { get }

0 commit comments

Comments
 (0)