@@ -465,25 +465,29 @@ protocol r21783216b {
465
465
associatedtype `Protocol` // ok
466
466
}
467
467
468
- struct SR7249 < T> {
469
- var x : T { fatalError ( ) } // expected-note {{previously declared}}
468
+ // https://github.com/apple/swift/issues/49797
469
+
470
+ struct S_49797 < T> {
471
+ var x : T { get { } } // expected-note {{previously declared}}
470
472
var y : Int // expected-note {{previously declared}}
471
473
var z : Int // expected-note {{previously declared}}
472
474
}
473
475
474
- extension SR7249 {
475
- var x : Int { fatalError ( ) } // expected-warning{{redeclaration of 'x' is deprecated and will be an error in Swift 5}}
476
- var y : T { fatalError ( ) } // expected-warning{{redeclaration of 'y' is deprecated and will be an error in Swift 5}}
477
- var z : Int { fatalError ( ) } // expected-error{{invalid redeclaration of 'z'}}
476
+ extension S_49797 {
477
+ var x : Int { get { } } // expected-warning{{redeclaration of 'x' is deprecated and will be an error in Swift 5}}
478
+ var y : T { get { } } // expected-warning{{redeclaration of 'y' is deprecated and will be an error in Swift 5}}
479
+ var z : Int { get { } } // expected-error{{invalid redeclaration of 'z'}}
478
480
}
479
481
480
482
// A constrained extension is okay.
481
- extension SR7249 where T : P1 {
482
- var x : Int { fatalError ( ) }
483
- var y : T { fatalError ( ) }
484
- var z : Int { fatalError ( ) }
483
+ extension S_49797 where T : P1 {
484
+ var x : Int { get { } }
485
+ var y : T { get { } }
486
+ var z : Int { get { } }
485
487
}
486
488
489
+ // https://github.com/apple/swift/issues/49798
490
+
487
491
protocol P3 {
488
492
var i : Int { get }
489
493
subscript( i: Int ) -> String { get }
@@ -494,135 +498,129 @@ extension P3 {
494
498
subscript( i: Int ) -> String { return " " }
495
499
}
496
500
497
- struct SR7250 < T> : P3 { }
501
+ struct S_49798 < T> : P3 { }
498
502
499
- extension SR7250 where T : P3 {
500
- var i : Int { return 0 }
501
- subscript( i: Int ) -> String { return " " }
503
+ extension S_49798 where T : P3 {
504
+ var i : Int { get { } }
505
+ subscript( i: Int ) -> String { get { } }
502
506
}
503
507
504
- // SR-10084
508
+ // https://github.com/apple/swift/issues/52486
505
509
506
- struct SR_10084_S {
510
+ struct S_52486 {
507
511
let name : String
508
512
}
509
513
510
- enum SR_10084_E {
511
- case foo( SR_10084_S ) // expected-note {{'foo' previously declared here}}
514
+ enum E_52486 {
515
+ case foo( S_52486 ) // expected-note {{'foo' previously declared here}}
512
516
513
- static func foo( _ name: String ) -> SR_10084_E { // Okay
514
- return . foo( SR_10084_S ( name: name) )
517
+ static func foo( _ name: String ) -> E_52486 { // Okay
518
+ return . foo( S_52486 ( name: name) )
515
519
}
516
520
517
- func foo( _ name: Bool ) -> SR_10084_E { // Okay
518
- return . foo( SR_10084_S ( name: " Test " ) )
521
+ func foo( _ name: Bool ) -> E_52486 { // Okay
522
+ return . foo( S_52486 ( name: " Test " ) )
519
523
}
520
524
521
- static func foo( _ value: SR_10084_S ) -> SR_10084_E { // expected-error {{invalid redeclaration of 'foo'}}
525
+ static func foo( _ value: S_52486 ) -> E_52486 { // expected-error {{invalid redeclaration of 'foo'}}
522
526
return . foo( value)
523
527
}
524
528
}
525
529
526
- enum SR_10084_E_1 {
527
- static func foo( _ name: String ) -> SR_10084_E_1 { // Okay
528
- return . foo( SR_10084_S ( name: name) )
530
+ enum E1_52486 {
531
+ static func foo( _ name: String ) -> E1_52486 { // Okay
532
+ return . foo( S_52486 ( name: name) )
529
533
}
530
534
531
- static func foo( _ value: SR_10084_S ) -> SR_10084_E_1 { // expected-note {{'foo' previously declared here}}
535
+ static func foo( _ value: S_52486 ) -> E1_52486 { // expected-note {{'foo' previously declared here}}
532
536
return . foo( value)
533
537
}
534
538
535
- case foo( SR_10084_S ) // expected-error {{invalid redeclaration of 'foo'}}
539
+ case foo( S_52486 ) // expected-error {{invalid redeclaration of 'foo'}}
536
540
}
537
541
538
- enum SR_10084_E_2 {
542
+ enum E2_52486 {
539
543
case fn( ( ) -> Void ) // expected-note {{'fn' previously declared here}}
540
544
541
- static func fn( _ x: @escaping ( ) -> Void ) -> SR_10084_E_2 { // expected-error {{invalid redeclaration of 'fn'}}
542
- fatalError ( )
543
- }
545
+ static func fn( _ x: @escaping ( ) -> Void ) -> E2_52486 { } // expected-error {{invalid redeclaration of 'fn'}}
544
546
545
- static func fn( _ x: @escaping ( ) -> Int ) -> SR_10084_E_2 { // Okay
546
- fatalError ( )
547
- }
547
+ static func fn( _ x: @escaping ( ) -> Int ) -> E2_52486 { } // Okay
548
548
549
- static func fn( _ x: @escaping ( ) -> Bool ) -> SR_10084_E_2 { // Okay
550
- fatalError ( )
551
- }
549
+ static func fn( _ x: @escaping ( ) -> Bool ) -> E2_52486 { } // Okay
552
550
}
553
551
554
552
// N.B. Redeclaration checks don't see this case because `protocol A` is invalid.
555
- enum SR_10084_E_3 {
553
+ enum E3_52486 {
556
554
protocol A { } //expected-error {{protocol 'A' cannot be nested inside another declaration}}
557
555
case A
558
556
}
559
557
560
- enum SR_10084_E_4 {
558
+ enum E4_52486 {
561
559
class B { } // expected-note {{'B' previously declared here}}
562
560
case B // expected-error {{invalid redeclaration of 'B'}}
563
561
}
564
562
565
- enum SR_10084_E_5 {
563
+ enum E5_52486 {
566
564
struct C { } // expected-note {{'C' previously declared here}}
567
565
case C // expected-error {{invalid redeclaration of 'C'}}
568
566
}
569
567
570
568
// N.B. Redeclaration checks don't see this case because `protocol D` is invalid.
571
- enum SR_10084_E_6 {
569
+ enum E6_52486 {
572
570
case D
573
571
protocol D { } //expected-error {{protocol 'D' cannot be nested inside another declaration}}
574
572
}
575
573
576
- enum SR_10084_E_7 {
574
+ enum E7_52486 {
577
575
case E // expected-note {{'E' previously declared here}}
578
576
class E { } // expected-error {{invalid redeclaration of 'E'}}
579
577
}
580
578
581
- enum SR_10084_E_8 {
579
+ enum E8_52486 {
582
580
case F // expected-note {{'F' previously declared here}}
583
581
struct F { } // expected-error {{invalid redeclaration of 'F'}}
584
582
}
585
583
586
- enum SR_10084_E_9 {
584
+ enum E9_52486 {
587
585
case A // expected-note {{'A' previously declared here}} expected-note {{found this candidate}}
588
- static let A : SR_10084_E_9 = . A // expected-error {{invalid redeclaration of 'A'}}
586
+ static let A : E9_52486 = . A // expected-error {{invalid redeclaration of 'A'}}
589
587
// expected-error@-1 {{ambiguous use of 'A'}} expected-note@-1 {{found this candidate}}
590
588
}
591
589
592
- enum SR_10084_E_10 {
593
- static let A : SR_10084_E_10 = . A // expected-note {{'A' previously declared here}}
590
+ enum E10_52486 {
591
+ static let A : E10_52486 = . A // expected-note {{'A' previously declared here}}
594
592
// expected-error@-1 {{ambiguous use of 'A'}} expected-note@-1 {{found this candidate}}
595
593
case A // expected-error {{invalid redeclaration of 'A'}} expected-note {{found this candidate}}
596
594
}
597
595
598
- enum SR_10084_E_11 {
596
+ enum E11_52486 {
599
597
case A // expected-note {{'A' previously declared here}} expected-note {{found this candidate}}
600
- static var A : SR_10084_E_11 = . A // expected-error {{invalid redeclaration of 'A'}}
598
+ static var A : E11_52486 = . A // expected-error {{invalid redeclaration of 'A'}}
601
599
// expected-error@-1 {{ambiguous use of 'A'}} expected-note@-1 {{found this candidate}}
602
600
}
603
601
604
- enum SR_10084_E_12 {
605
- static var A : SR_10084_E_12 = . A // expected-note {{'A' previously declared here}}
602
+ enum E12_52486 {
603
+ static var A : E12_52486 = . A // expected-note {{'A' previously declared here}}
606
604
// expected-error@-1 {{ambiguous use of 'A'}} expected-note@-1 {{found this candidate}}
607
605
case A // expected-error {{invalid redeclaration of 'A'}} expected-note {{found this candidate}}
608
606
}
609
607
610
- enum SR_10084_E_13 {
608
+ enum E13_52486 {
611
609
case X // expected-note {{'X' previously declared here}}
612
610
struct X < T> { } // expected-error {{invalid redeclaration of 'X'}}
613
611
}
614
612
615
- enum SR_10084_E_14 {
613
+ enum E14_52486 {
616
614
struct X < T> { } // expected-note {{'X' previously declared here}}
617
615
case X // expected-error {{invalid redeclaration of 'X'}}
618
616
}
619
617
620
- enum SR_10084_E_15 {
618
+ enum E15_52486 {
621
619
case Y // expected-note {{'Y' previously declared here}}
622
620
typealias Y = Int // expected-error {{invalid redeclaration of 'Y'}}
623
621
}
624
622
625
- enum SR_10084_E_16 {
623
+ enum E16_52486 {
626
624
typealias Z = Int // expected-note {{'Z' previously declared here}}
627
625
case Z // expected-error {{invalid redeclaration of 'Z'}}
628
626
}
0 commit comments