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
@@ -252,11 +258,14 @@ func testExplicitCoercionRequirement(v: any B, otherV: any B & D) {
252
258
253
259
_ =getC(v) // expected-error {{inferred result type 'any P' requires explicit coercion due to loss of generic requirements}} {{14-14=as any P}}
254
260
_ =getC(v)asanyP // Ok
255
-
261
+
262
+
_ =getE(v) // expected-error {{inferred result type 'any P1<Double>' requires explicit coercion due to loss of generic requirements}} {{14-14=as any P1<Double>}}
263
+
_ =getE(v)asanyP1<Double> // Ok
264
+
256
265
_ =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)}}
257
266
_ =getTuple(v)as(anyB,anyP) // Ok
258
-
259
-
_ =getNoError(v) // Ok because T.C.A == Double
267
+
// Ok because T.C.A == Double
268
+
_ =getNoError(v)
260
269
261
270
_ =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])}}
262
271
_ =getComplex(v)as([(x:(a:anyP, b:Int), y:Int)],[Int:anyP]) // Ok
@@ -305,3 +314,58 @@ func testExplicitCoercionRequirement(v: any B, otherV: any B & D) {
305
314
getP((getC(v)asanyP)) // Ok - parens avoid opening suppression
306
315
getP((v.getC()asanyP)) // Ok - parens avoid opening suppression
// CHECK: } // end sil function '$s42existential_member_accesses_self_assoctype33testCovariantAssocGenericSubClass2p5AA0ijK0CySbGAA2P5_pSb1AAaGPRts_XP_tF'
0 commit comments