1- // RUN: %target-typecheck-verify-swift
2- // RUN: %target-typecheck-verify-swift -debug-generic-signatures > %t.dump 2>&1
1+ // RUN: %target-typecheck-verify-swift -requirement-machine-protocol-signatures=verify
2+ // RUN: %target-typecheck-verify-swift -debug-generic-signatures > %t.dump -requirement-machine-protocol-signatures=verify 2>&1
33// RUN: %FileCheck %s < %t.dump
44
55protocol P1 {
@@ -323,22 +323,6 @@ struct X24<T: P20> : P24 {
323323 typealias C = T
324324}
325325
326- // CHECK-LABEL: .P25a@
327- // CHECK-NEXT: Requirement signature: <Self where Self.[P25a]A == X24<Self.[P25a]B>, Self.[P25a]B : P20>
328- // CHECK-NEXT: Canonical requirement signature: <τ_0_0 where τ_0_0.[P25a]A == X24<τ_0_0.[P25a]B>, τ_0_0.[P25a]B : P20>
329- protocol P25a {
330- associatedtype A : P24 // expected-warning{{redundant conformance constraint 'Self.A' : 'P24'}}
331- associatedtype B : P20 where A == X24 < B > // expected-note{{conformance constraint 'Self.A' : 'P24' implied here}}
332- }
333-
334- // CHECK-LABEL: .P25b@
335- // CHECK-NEXT: Requirement signature: <Self where Self.[P25b]A == X24<Self.[P25b]B>, Self.[P25b]B : P20>
336- // CHECK-NEXT: Canonical requirement signature: <τ_0_0 where τ_0_0.[P25b]A == X24<τ_0_0.[P25b]B>, τ_0_0.[P25b]B : P20>
337- protocol P25b {
338- associatedtype A
339- associatedtype B : P20 where A == X24 < B >
340- }
341-
342326protocol P25c {
343327 associatedtype A : P24
344328 associatedtype B where A == X < B > // expected-error{{cannot find type 'X' in scope}}
@@ -349,32 +333,6 @@ protocol P25d {
349333 associatedtype B where A == X24 < B > // expected-error{{type 'Self.B' does not conform to protocol 'P20'}}
350334}
351335
352- // Similar to the above, but with superclass constraints.
353- protocol P26 {
354- associatedtype C : X3
355- }
356-
357- struct X26 < T: X3 > : P26 {
358- typealias C = T
359- }
360-
361- // CHECK-LABEL: .P27a@
362- // CHECK-NEXT: Requirement signature: <Self where Self.[P27a]A == X26<Self.[P27a]B>, Self.[P27a]B : X3>
363- // CHECK-NEXT: Canonical requirement signature: <τ_0_0 where τ_0_0.[P27a]A == X26<τ_0_0.[P27a]B>, τ_0_0.[P27a]B : X3>
364- protocol P27a {
365- associatedtype A : P26 // expected-warning{{redundant conformance constraint 'Self.A' : 'P26'}}
366-
367- associatedtype B : X3 where A == X26 < B > // expected-note{{conformance constraint 'Self.A' : 'P26' implied here}}
368- }
369-
370- // CHECK-LABEL: .P27b@
371- // CHECK-NEXT: Requirement signature: <Self where Self.[P27b]A == X26<Self.[P27b]B>, Self.[P27b]B : X3>
372- // CHECK-NEXT: Canonical requirement signature: <τ_0_0 where τ_0_0.[P27b]A == X26<τ_0_0.[P27b]B>, τ_0_0.[P27b]B : X3>
373- protocol P27b {
374- associatedtype A
375- associatedtype B : X3 where A == X26 < B >
376- }
377-
378336// ----------------------------------------------------------------------------
379337// Inference of associated type relationships within a protocol hierarchy
380338// ----------------------------------------------------------------------------
0 commit comments