File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2092,15 +2092,15 @@ bool swift::conflicting(ASTContext &ctx,
2092
2092
2093
2093
// Functions and enum elements do not conflict with each other if their types
2094
2094
// are different.
2095
- if ((sig1.IsFunction == sig2.IsEnumElement ||
2096
- sig1.IsEnumElement == sig2.IsFunction ) &&
2095
+ if ((( sig1.IsFunction && sig2.IsEnumElement ) ||
2096
+ ( sig1.IsEnumElement && sig2.IsFunction ) ) &&
2097
2097
sig1Type != sig2Type) {
2098
2098
return false ;
2099
2099
}
2100
2100
2101
2101
// Enum elements always conflict with each other. At this point, they
2102
2102
// have the same base name but different types.
2103
- if (sig1.IsEnumElement == sig2.IsEnumElement ) {
2103
+ if (sig1.IsEnumElement && sig2.IsEnumElement ) {
2104
2104
return true ;
2105
2105
}
2106
2106
Original file line number Diff line number Diff line change @@ -495,15 +495,15 @@ enum SR_10084_E {
495
495
}
496
496
497
497
enum SR_10084_E_1 {
498
- static func foo( _ name: String ) -> SR_10084_E_1 { // expected-note {{'foo' previously declared here}}
498
+ static func foo( _ name: String ) -> SR_10084_E_1 {
499
499
return . foo( SR_10084_S ( name: name) )
500
500
}
501
501
502
- static func foo( _ value: SR_10084_S ) -> SR_10084_E_1 { // expected-error {{invalid redeclaration of 'foo'}}
502
+ static func foo( _ value: SR_10084_S ) -> SR_10084_E_1 { // expected-note {{'foo' previously declared here }}
503
503
return . foo( value)
504
504
}
505
505
506
- case foo( SR_10084_S )
506
+ case foo( SR_10084_S ) // expected-error {{invalid redeclaration of 'foo'}}
507
507
}
508
508
509
509
enum SR_10084_E_2 {
You can’t perform that action at this time.
0 commit comments