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
a.flatMap(SR15281_B.init(a:)) // expected-error{{cannot convert return expression of type 'SR15281_B?' to return type 'SR15281_B'}} {{34-34=!}}
629
+
}
630
+
627
631
varb1:SR15281_B{
628
632
a.flatMap(SR15281_B.init(a:))as!SR15281_B
629
633
// expected-warning@-1 {{forced cast from 'SR15281_B?' to 'SR15281_B' only unwraps optionals; did you mean to use '!'?}} {{34-34=!}} {{34-48=}}
630
634
}
635
+
}
636
+
637
+
classSR15281_AC{}
638
+
classSR15281_BC{
639
+
init(a:SR15281_AC){}
640
+
}
641
+
classSR15281_CC:SR15281_BC{}
642
+
643
+
structSR15281_SC{
644
+
vara:SR15281_AC?=SR15281_AC()
645
+
646
+
varb:SR15281_BC{
647
+
a.flatMap(SR15281_BC.init(a:)) // expected-error{{cannot convert return expression of type 'SR15281_BC?' to return type 'SR15281_BC'}} {{35-35=!}}
648
+
}
631
649
632
-
varb:SR15281_B{
633
-
a.flatMap(SR15281_B.init(a:)) // expected-error{{cannot convert return expression of type 'SR15281_B?' to return type 'SR15281_B'}} {{34-34= as! SR15281_B}}
650
+
varc:SR15281_BC{
651
+
a.flatMap(SR15281_CC.init(a:)) // expected-error{{cannot convert return expression of type 'SR15281_CC?' to return type 'SR15281_BC'}} {{35-35=!}}
0 commit comments