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
// expected-note@-1 {{inferred result type '(x: Int, y: any P)' requires explicit coercion due to loss of generic requirements}} {{240:20-20=as (x: Int, y: any P)}}
226
+
func overloaded<T:P>(_:T)->Int{42}
227
+
// expected-note@-1 {{candidate requires that 'any B' conform to 'P' (requirement specified as 'T' : 'P')}}
228
+
229
+
_ =getC(v) // expected-error {{inferred result type 'any P' requires explicit coercion due to loss of generic requirements}} {{14-14=as any P}}
230
+
_ =getC(v)asanyP // Ok
231
+
232
+
_ =getTuple(v) // expected-error {{inferred result type '(any B, any P)' requires explicit coercion due to loss of generic requirements}} {{18-18=as (any B, any P)}}
233
+
_ =getTuple(v)as(anyB,anyP) // Ok
234
+
235
+
_ =getNoError(v) // Ok because T.C.A == Double
236
+
237
+
_ =getComplex(v) // expected-error {{inferred result type '([(x: (a: any P, b: Int), y: Int)], [Int : any P])' requires explicit coercion due to loss of generic requirements}} {{20-20=as ([(x: (a: any P, b: Int), y: Int)], [Int : any P])}}
238
+
_ =getComplex(v)as([(x:(a:anyP, b:Int), y:Int)],[Int:anyP]) // Ok
239
+
240
+
_ =overloaded(v) // expected-error {{no exact matches in call to local function 'overloaded'}}
0 commit comments