File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -2090,17 +2090,20 @@ bool swift::conflicting(ASTContext &ctx,
2090
2090
if (!conflicting (sig1, sig2, skipProtocolExtensionCheck))
2091
2091
return false ;
2092
2092
2093
- // Two enum elements always conflict with each other. At this point, they
2093
+ // Functions and enum elements do not conflict with each other if their types
2094
+ // are different.
2095
+ if ((sig1.IsFunction == sig2.IsEnumElement ||
2096
+ sig1.IsEnumElement == sig2.IsFunction ) &&
2097
+ sig1Type != sig2Type) {
2098
+ return false ;
2099
+ }
2100
+
2101
+ // Enum elements always conflict with each other. At this point, they
2094
2102
// have the same base name but different types.
2095
2103
if (sig1.IsEnumElement == sig2.IsEnumElement ) {
2096
2104
return true ;
2097
2105
}
2098
2106
2099
- // A function does not conflict with an enum element if their types differ.
2100
- if (sig1.IsFunction == sig2.IsEnumElement && sig1Type != sig2Type) {
2101
- return false ;
2102
- }
2103
-
2104
2107
// Functions always conflict with non-functions with the same signature.
2105
2108
// In practice, this only applies for zero argument functions.
2106
2109
if (sig1.IsFunction != sig2.IsFunction )
You can’t perform that action at this time.
0 commit comments