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
[Typechecker] Fix an issue with redeclaration checking (swiftlang#23227)
* [typechecker] fix an issue with redeclaration checking
* [typechecker] use mapSignatureFunctionType in getOverloadSignatureType() to compute the type for the enum element decl, etc
* [typechecker] allow matching enums to functions as well, not just functions to enums
* [typechecker] fix the check for two enums
* [typechecker] check for nominal types as well when comparing enum elements
* [test] add more tests
* [typechecker] check for typealias as well
case C // expected-error {{invalid redeclaration of 'C'}}
542
+
}
543
+
544
+
enumSR_10084_E_6{
545
+
case D // expected-note {{'D' previously declared here}}
546
+
protocolD{} //expected-error {{protocol 'D' cannot be nested inside another declaration}} // expected-error {{invalid redeclaration of 'D'}}
547
+
}
548
+
549
+
enumSR_10084_E_7{
550
+
case E // expected-note {{'E' previously declared here}}
551
+
classE{} // expected-error {{invalid redeclaration of 'E'}}
552
+
}
553
+
554
+
enumSR_10084_E_8{
555
+
case F // expected-note {{'F' previously declared here}}
556
+
structF{} // expected-error {{invalid redeclaration of 'F'}}
557
+
}
558
+
559
+
enumSR_10084_E_9{
560
+
case A // expected-note {{found this candidate}} // expected-note {{'A' previously declared here}}
561
+
staticletA:SR_10084_E_9=.A // expected-note {{found this candidate}} // expected-error {{invalid redeclaration of 'A'}} // expected-error {{ambiguous use of 'A'}}
562
+
}
563
+
564
+
enumSR_10084_E_10{
565
+
staticletA:SR_10084_E_10=.A // expected-note {{found this candidate}} // expected-note {{'A' previously declared here}} // expected-error {{ambiguous use of 'A'}}
566
+
case A // expected-note {{found this candidate}} // expected-error {{invalid redeclaration of 'A'}}
567
+
}
568
+
569
+
enumSR_10084_E_11{
570
+
case A // expected-note {{found this candidate}} // expected-note {{'A' previously declared here}}
571
+
staticvarA:SR_10084_E_11=.A // expected-note {{found this candidate}} // expected-error {{invalid redeclaration of 'A'}} // expected-error {{ambiguous use of 'A'}}
572
+
}
573
+
574
+
enumSR_10084_E_12{
575
+
staticvarA:SR_10084_E_12=.A // expected-note {{found this candidate}} // expected-note {{'A' previously declared here}} // expected-error {{ambiguous use of 'A'}}
576
+
case A // expected-note {{found this candidate}} // expected-error {{invalid redeclaration of 'A'}}
577
+
}
578
+
579
+
enumSR_10084_E_13{
580
+
case X // expected-note {{'X' previously declared here}}
581
+
structX<T>{} // expected-error {{invalid redeclaration of 'X'}}
0 commit comments