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
_ =(str ??"")asString // expected-warning {{left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used}}
_ = c1 as?NotConformsFinal // expected-warning {{cast from 'any ProtocolP & Composition' (aka 'any ProtocolP & ProtocolP1 & ProtocolQ1') to unrelated type 'NotConformsFinal' always fails}}
490
494
}
491
495
492
-
// SR-13899
493
-
classSR13899_Base{}
494
-
classSR13899_Derived:SR13899_Base{}
495
-
496
-
protocolSR13899_P{}
497
-
classSR13899_A:SR13899_P{}
498
-
499
-
typealiasDA=SR13899_Derived
500
-
typealiasBA=SR13899_Base
501
-
typealiasClosureType=(SR13899_Derived)->Void
502
-
503
-
letblockp={(_:SR13899_A)in}
504
-
letblock={(_:SR13899_Base)in}
505
-
letderived={(_:SR13899_Derived)in}
506
-
507
-
letblockalias={(_:BA)in}
508
-
letderivedalias={(_:DA)in}
509
-
510
-
let _ = block is ClosureType // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to 'ClosureType' (aka '(SR13899_Derived) -> ()') is not supported; 'is' test always fails}}
511
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-17=as}}
512
-
let _ = blockalias is (SR13899_Derived)->Void // expected-warning{{runtime conversion from '(BA) -> ()' (aka '(SR13899_Base) -> ()') to '(SR13899_Derived) -> Void' is not supported; 'is' test always fails}}
513
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{20-22=as}}
514
-
let _ = block is (SR13899_Derived)->Void // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to '(SR13899_Derived) -> Void' is not supported; 'is' test always fails}}
515
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-17=as}}
516
-
let _ = block is (SR13899_Derived)->Void // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to '(SR13899_Derived) -> Void' is not supported; 'is' test always fails}}
517
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-17=as}}
518
-
519
-
let _ = block as!ClosureType // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to 'ClosureType' (aka '(SR13899_Derived) -> ()') is not supported; cast always fails}}
520
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-18=as}}
521
-
let _ = blockalias as!(SR13899_Derived)->Void // expected-warning{{runtime conversion from '(BA) -> ()' (aka '(SR13899_Base) -> ()') to '(SR13899_Derived) -> Void' is not supported; cast always fails}}
522
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{20-23=as}}
523
-
let _ = block as!(SR13899_Derived)->Void // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to '(SR13899_Derived) -> Void' is not supported; cast always fails}}
524
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-18=as}}
525
-
let _ = block as!(SR13899_Derived)->Void // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to '(SR13899_Derived) -> Void' is not supported; cast always fails}}
526
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-18=as}}
527
-
528
-
let _ = block as?ClosureType // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to 'ClosureType' (aka '(SR13899_Derived) -> ()') is not supported; cast always fails}}
529
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-18=as}}
530
-
let _ = blockalias as?(SR13899_Derived)->Void // expected-warning{{runtime conversion from '(BA) -> ()' (aka '(SR13899_Base) -> ()') to '(SR13899_Derived) -> Void' is not supported; cast always fails}}
531
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{20-23=as}}
532
-
let _ = block as?(SR13899_Derived)->Void // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to '(SR13899_Derived) -> Void' is not supported; cast always fails}}
533
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-18=as}}
534
-
let _ = block as?(SR13899_Derived)->Void // expected-warning{{runtime conversion from '(SR13899_Base) -> ()' to '(SR13899_Derived) -> Void' is not supported; cast always fails}}
535
-
// expected-note@-1 {{consider using 'as' coercion instead}} {{15-18=as}}
536
-
537
-
538
-
let _ = derived is (SR13899_Base)->Void // expected-warning{{always fails}}
539
-
let _ = blockp is (SR13899_P)->Void // expected-warning{{always fails}}
540
-
541
-
// Types are trivially equal.
542
-
let _ = block is (SR13899_Base)->Void // expected-warning{{'is' test is always true}}
543
-
let _ = block is (SR13899_Base)throws->Void // expected-warning{{'is' test is always true}}
544
-
let _ = derivedalias is (SR13899_Derived)->Void // expected-warning{{'is' test is always true}}
545
-
let _ = derivedalias is (SR13899_Derived)throws->Void // expected-warning{{'is' test is always true}}
546
-
let _ = derived is (SR13899_Derived)->Void // expected-warning{{'is' test is always true}}
547
-
let _ = derived is (SR13899_Derived)throws->Void // expected-warning{{'is' test is always true}}
548
-
let _ = blockp is (SR13899_A)->Void //expected-warning{{'is' test is always true}}
549
-
let _ = blockp is (SR13899_A)throws->Void //expected-warning{{'is' test is always true}}
496
+
// https://github.com/apple/swift/issues/56297
497
+
498
+
classC1_56297_Base{}
499
+
classC1_56297_Sub:C1_56297_Base{}
500
+
501
+
protocolP_56297{}
502
+
classC2_56297:P_56297{}
503
+
504
+
do{
505
+
typealiasDA=C1_56297_Sub
506
+
typealiasBA=C1_56297_Base
507
+
typealiasClosureType=(C1_56297_Sub)->Void
508
+
509
+
letblockp={(_:C2_56297)in}
510
+
letblock={(_:C1_56297_Base)in}
511
+
letderived={(_:C1_56297_Sub)in}
512
+
513
+
letblockalias={(_:BA)in}
514
+
letderivedalias={(_:DA)in}
515
+
516
+
let _ = block is ClosureType // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to 'ClosureType' (aka '(C1_56297_Sub) -> ()') is not supported; 'is' test always fails}}
517
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-19=as}}
518
+
let _ = blockalias is (C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(BA) -> ()' (aka '(C1_56297_Base) -> ()') to '(C1_56297_Sub) -> Void' is not supported; 'is' test always fails}}
519
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{22-24=as}}
520
+
let _ = block is (C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to '(C1_56297_Sub) -> Void' is not supported; 'is' test always fails}}
521
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-19=as}}
522
+
let _ = block is (C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to '(C1_56297_Sub) -> Void' is not supported; 'is' test always fails}}
523
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-19=as}}
524
+
525
+
let _ = block as!ClosureType // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to 'ClosureType' (aka '(C1_56297_Sub) -> ()') is not supported; cast always fails}}
526
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-20=as}}
527
+
let _ = blockalias as!(C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(BA) -> ()' (aka '(C1_56297_Base) -> ()') to '(C1_56297_Sub) -> Void' is not supported; cast always fails}}
528
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{22-25=as}}
529
+
let _ = block as!(C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to '(C1_56297_Sub) -> Void' is not supported; cast always fails}}
530
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-20=as}}
531
+
let _ = block as!(C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to '(C1_56297_Sub) -> Void' is not supported; cast always fails}}
532
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-20=as}}
533
+
534
+
let _ = block as?ClosureType // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to 'ClosureType' (aka '(C1_56297_Sub) -> ()') is not supported; cast always fails}}
535
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-20=as}}
536
+
let _ = blockalias as?(C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(BA) -> ()' (aka '(C1_56297_Base) -> ()') to '(C1_56297_Sub) -> Void' is not supported; cast always fails}}
537
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{22-25=as}}
538
+
let _ = block as?(C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to '(C1_56297_Sub) -> Void' is not supported; cast always fails}}
539
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-20=as}}
540
+
let _ = block as?(C1_56297_Sub)->Void // expected-warning{{runtime conversion from '(C1_56297_Base) -> ()' to '(C1_56297_Sub) -> Void' is not supported; cast always fails}}
541
+
// expected-note@-1 {{consider using 'as' coercion instead}} {{17-20=as}}
542
+
543
+
544
+
let _ = derived is (C1_56297_Base)->Void // expected-warning{{always fails}}
545
+
let _ = blockp is (P_56297)->Void // expected-warning{{always fails}}
546
+
547
+
// Types are trivially equal.
548
+
let _ = block is (C1_56297_Base)->Void // expected-warning{{'is' test is always true}}
549
+
let _ = block is (C1_56297_Base)throws->Void // expected-warning{{'is' test is always true}}
550
+
let _ = derivedalias is (C1_56297_Sub)->Void // expected-warning{{'is' test is always true}}
551
+
let _ = derivedalias is (C1_56297_Sub)throws->Void // expected-warning{{'is' test is always true}}
552
+
let _ = derived is (C1_56297_Sub)->Void // expected-warning{{'is' test is always true}}
553
+
let _ = derived is (C1_56297_Sub)throws->Void // expected-warning{{'is' test is always true}}
554
+
let _ = blockp is (C2_56297)->Void //expected-warning{{'is' test is always true}}
555
+
let _ = blockp is (C2_56297)throws->Void //expected-warning{{'is' test is always true}}
556
+
}
550
557
551
558
protocolPP1{}
552
559
protocolPP2:PP1{}
553
560
extensionOptional:PP1where Wrapped ==PP2{}
554
561
555
562
nil is PP1 // expected-error {{'nil' requires a contextual type}}
556
563
557
-
// SR-15039
564
+
// https://github.com/apple/swift/issues/57366
565
+
558
566
enumChangeType<T>{
559
567
case initial(T)
560
568
case delta(previous:T, next:T)
@@ -568,7 +576,8 @@ extension ChangeType where T == String? {
0 commit comments