Skip to content

Commit d147898

Browse files
authored
Merge pull request #69688 from ktoso/wip-distributed-overloads-2
[follow-up][Distributed]Adjust overload detection for distributed funcs
2 parents 48b4ca0 + c0b1057 commit d147898

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/AST/Decl.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,14 +3227,12 @@ bool swift::conflicting(const OverloadSignature& sig1,
32273227
// versions, as that is what the async overloading aimed to address.
32283228
//
32293229
// Note also, that overloading on throws is already illegal anyway.
3230-
if (sig1.IsDistributed || sig2.IsDistributed) {
3231-
if (sig1.IsAsyncFunction != sig2.IsAsyncFunction)
3232-
return true;
3233-
} else {
3234-
// Otherwise one is an async function and the other is not, they don't conflict.
3230+
if (!sig1.IsDistributed && !sig2.IsDistributed) {
3231+
// For non-distributed functions,
3232+
// if one is an async function and the other is not, they don't conflict.
32353233
if (sig1.IsAsyncFunction != sig2.IsAsyncFunction)
32363234
return false;
3237-
}
3235+
} // else, if any of the methods was distributed, continue checking
32383236

32393237
// If one is a macro and the other is not, they can't conflict.
32403238
if (sig1.IsMacro != sig2.IsMacro)

0 commit comments

Comments
 (0)