@@ -16,6 +16,65 @@ struct __attribute__((swift_attr("conforms_to:SwiftTest.X"))) CX {};
1616struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.A " ) ) ) CA { } ;
1717struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.B " ) ) ) CB { } ;
1818
19+ struct __attribute__( ( swift_attr ( " conforms_to:X " ) ) )
20+ __attribute__ ( ( swift_attr ( " conforms_to:X " ) ) ) CXX { } ;
21+ struct __attribute__( ( swift_attr ( " conforms_to:X " ) ) )
22+ __attribute__ ( ( swift_attr ( " conforms_to:Mod.X " ) ) ) CXModX { } ;
23+ struct __attribute__( ( swift_attr ( " conforms_to:X " ) ) )
24+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.X " ) ) ) CXTextX { } ;
25+ struct __attribute__( ( swift_attr ( " conforms_to:X " ) ) )
26+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.A " ) ) ) CXA { } ;
27+ struct __attribute__( ( swift_attr ( " conforms_to:X " ) ) )
28+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.B " ) ) ) CXB { } ;
29+ struct __attribute__( ( swift_attr ( " conforms_to:X " ) ) )
30+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.C " ) ) ) CXC { } ;
31+
32+
33+ struct __attribute__( ( swift_attr ( " conforms_to:Mod.X " ) ) )
34+ __attribute__ ( ( swift_attr ( " conforms_to:Mod.X " ) ) ) CModXModX { } ;
35+ struct __attribute__( ( swift_attr ( " conforms_to:Mod.X " ) ) )
36+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.X " ) ) ) CModXTestX { } ;
37+ struct __attribute__( ( swift_attr ( " conforms_to:Mod.X " ) ) )
38+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.A " ) ) ) CModXA { } ;
39+ struct __attribute__( ( swift_attr ( " conforms_to:Mod.X " ) ) )
40+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.B " ) ) ) CModXB { } ;
41+ struct __attribute__( ( swift_attr ( " conforms_to:Mod.X " ) ) )
42+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.C " ) ) ) CModXC { } ;
43+
44+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.X " ) ) )
45+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.X " ) ) ) CTestXTextX { } ;
46+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.X " ) ) )
47+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.A " ) ) ) CTextXA { } ;
48+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.X " ) ) )
49+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.B " ) ) ) CTextXB { } ;
50+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.X " ) ) )
51+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.C " ) ) ) CTextXC { } ;
52+
53+
54+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.A " ) ) )
55+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.A " ) ) ) CAA { } ;
56+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.A " ) ) )
57+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.B " ) ) ) CAB { } ;
58+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.A " ) ) )
59+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.C " ) ) ) CAC { } ;
60+
61+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.B " ) ) )
62+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.B " ) ) ) CBB { } ;
63+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.B " ) ) )
64+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.C " ) ) ) CBC { } ;
65+
66+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.C " ) ) )
67+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.C " ) ) ) CCC { } ;
68+
69+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.D " ) ) ) CD { } ;
70+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.D " ) ) ) CDD: CD { } ;
71+
72+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.D " ) ) ) CD2 { } ;
73+ struct CCDCD2 : CD , CD2 { } ;
74+
75+ struct __attribute__( ( swift_attr ( " conforms_to:SwiftTest.D " ) ) )
76+ __attribute__ ( ( swift_attr ( " conforms_to:SwiftTest.E " ) ) ) CDE { } ;
77+
1978//--- test.swift
2079
2180import Test
@@ -25,10 +84,78 @@ struct B {}
2584protocol A { }
2685protocol A { }
2786
87+ protocol C { }
88+ protocol D { }
89+ protocol E : D { }
90+
2891// CHECK: error: expected module name and protocol name separated by '.' in protocol conformance; 'X' is invalid
2992// CHECK: module 'Mod' in specified protocol conformance 'Mod.X' is not found; did you mean to import it first?
3093// CHECK: error: protocol 'X' in specified protocol conformance is not found in module 'SwiftTest'
3194// CHECK: error: ambiguous reference to protocol 'A' in specified protocol conformance; module 'SwiftTest' contains multiple protocols named 'A'
3295// CHECK: error: struct 'B' referenced in protocol conformance 'SwiftTest.B' is not a protocol
33-
3496func test( _ inv: CInv , _ invMod: CModInv , _ x: CX , _ a: CA , _ b: CB ) { }
97+
98+ // CHECK: error: expected module name and protocol name separated by '.' in protocol conformance; 'X' is invalid
99+ // CHECK: error: expected module name and protocol name separated by '.' in protocol conformance; 'X' is invalid
100+
101+ // CHECK: error: expected module name and protocol name separated by '.' in protocol conformance; 'X' is invalid
102+ // CHECK: module 'Mod' in specified protocol conformance 'Mod.X' is not found; did you mean to import it first?
103+
104+ // CHECK: error: expected module name and protocol name separated by '.' in protocol conformance; 'X' is invalid
105+ // CHECK: error: protocol 'X' in specified protocol conformance is not found in module 'SwiftTest'
106+
107+ // CHECK: error: expected module name and protocol name separated by '.' in protocol conformance; 'X' is invalid
108+ // CHECK: error: ambiguous reference to protocol 'A' in specified protocol conformance; module 'SwiftTest' contains multiple protocols named 'A'
109+
110+ // CHECK: error: expected module name and protocol name separated by '.' in protocol conformance; 'X' is invalid
111+ // CHECK: error: struct 'B' referenced in protocol conformance 'SwiftTest.B' is not a protocol
112+
113+ // CHECK: error: expected module name and protocol name separated by '.' in protocol conformance; 'X' is invalid
114+ func test( _ xx: CXX , _ xModx: CXModX , _ xTextX: CXTextX , _ cxa: CXA , _ cxb: CXB , _ cxc: CXC ) { }
115+
116+ // CHECK: module 'Mod' in specified protocol conformance 'Mod.X' is not found; did you mean to import it first?
117+ // CHECK: module 'Mod' in specified protocol conformance 'Mod.X' is not found; did you mean to import it first?
118+
119+ // CHECK: module 'Mod' in specified protocol conformance 'Mod.X' is not found; did you mean to import it first?
120+ // CHECK: error: protocol 'X' in specified protocol conformance is not found in module 'SwiftTest'
121+
122+ // CHECK: module 'Mod' in specified protocol conformance 'Mod.X' is not found; did you mean to import it first?
123+ // CHECK: error: ambiguous reference to protocol 'A' in specified protocol conformance; module 'SwiftTest' contains multiple protocols named 'A'
124+
125+ // CHECK: module 'Mod' in specified protocol conformance 'Mod.X' is not found; did you mean to import it first?
126+ // CHECK: error: struct 'B' referenced in protocol conformance 'SwiftTest.B' is not a protocol
127+
128+ // CHECK: module 'Mod' in specified protocol conformance 'Mod.X' is not found; did you mean to import it first?
129+ func test( _ modXModX: CModXModX , _ modXTestX: CModXTestX , _ modXA: CModXA , _ modXB: CModXB , _ modXC: CModXC ) { }
130+
131+ // CHECK: error: protocol 'X' in specified protocol conformance is not found in module 'SwiftTest'
132+ // CHECK: error: protocol 'X' in specified protocol conformance is not found in module 'SwiftTest'
133+
134+ // CHECK: error: protocol 'X' in specified protocol conformance is not found in module 'SwiftTest'
135+ // CHECK: error: ambiguous reference to protocol 'A' in specified protocol conformance; module 'SwiftTest' contains multiple protocols named 'A'
136+
137+ // CHECK: error: protocol 'X' in specified protocol conformance is not found in module 'SwiftTest'
138+ // CHECK: error: struct 'B' referenced in protocol conformance 'SwiftTest.B' is not a protocol
139+
140+ // CHECK: error: protocol 'X' in specified protocol conformance is not found in module 'SwiftTest'
141+ func test( _ testXTextX: CTestXTextX , _ textXA: CTextXA , _ textXB: CTextXB , _ textXC: CTextXC ) { }
142+
143+ // CHECK: error: ambiguous reference to protocol 'A' in specified protocol conformance; module 'SwiftTest' contains multiple protocols named 'A'
144+ // CHECK: error: ambiguous reference to protocol 'A' in specified protocol conformance; module 'SwiftTest' contains multiple protocols named 'A'
145+
146+ // CHECK: error: ambiguous reference to protocol 'A' in specified protocol conformance; module 'SwiftTest' contains multiple protocols named 'A'
147+ // CHECK: error: struct 'B' referenced in protocol conformance 'SwiftTest.B' is not a protocol
148+
149+ // CHECK: error: ambiguous reference to protocol 'A' in specified protocol conformance; module 'SwiftTest' contains multiple protocols named 'A'
150+ func test( _ aa: CAA , _ ab: CAB , _ ac: CAC ) { }
151+
152+ // CHECK: error: struct 'B' referenced in protocol conformance 'SwiftTest.B' is not a protocol
153+ func test( _ bb: CBB , _ bc: CBC ) { }
154+
155+ // CHECK: error: redundant conformance of 'CCC' to protocol 'SwiftTest.C'
156+ func test( _ cc: CCC ) { }
157+
158+ // CHECK-NOT: error: redundant conformance of 'CDD' to protocol 'SwiftTest.D'
159+ // CHECK-NOT: error: redundant conformance of 'CCDCD2' to protocol 'SwiftTest.D'
160+ // CHECK-NOT: error: redundant conformance of 'CDE' to protocol 'SwiftTest.D'
161+ func test( _ dd: CDD , _ dd2: CCDCD2 , de: CDE ) { }
0 commit comments