You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Constraints/opened_existentials.swift
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -311,15 +311,15 @@ class C1 {}
311
311
classC2<T>:C1{}
312
312
313
313
// Protocols With Associated Types
314
-
protocolQ{
314
+
protocolT{
315
315
associatedtypeA
316
316
associatedtypeB:C2<A>
317
317
318
318
func returnAssocTypeB()->B
319
319
}
320
320
321
-
func testAssocReturn(p:anyQ){
322
-
let _ = p.returnAssocTypeB() // expected-error {{inferred result type 'C2<(any U<String>).A>' requires explicit coercion due to loss of generic requirements}} {{14-14=as as C2<(any Q).A>}}
321
+
func testAssocReturn(p:anyT){
322
+
let _ = p.returnAssocTypeB() // expected-error {{inferred result type 'C2<(any T).A>' requires explicit coercion due to loss of generic requirements}} {{29-29=as C2<(any T).A>}}
323
323
}
324
324
325
325
// Protocols With Primary Associated Types
@@ -333,11 +333,11 @@ protocol U<A> {
333
333
}
334
334
335
335
func testPrimaryAssocReturn(p:anyU<String>){
336
-
let _ = p.returnAssocTypeB()
336
+
let _ = p.returnAssocTypeB() // expected-error {{inferred result type 'C2<(any U<String>).A>' requires explicit coercion due to loss of generic requirements}} {{29-29=as C2<(any U<String>).A>}}
337
337
}
338
338
339
339
func testPrimaryAssocReturn(p:anyU<Int>){
340
-
let _ = p.returnPrimaryAssocTypeA() // what would the output even be here?
0 commit comments