Skip to content

Commit 6ff4513

Browse files
committed
Adjust overload detection for distributed funcs
1 parent cade15b commit 6ff4513

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
@@ -3095,14 +3095,12 @@ bool swift::conflicting(const OverloadSignature& sig1,
30953095
// versions, as that is what the async overloading aimed to address.
30963096
//
30973097
// Note also, that overloading on throws is already illegal anyway.
3098-
if (sig1.IsDistributed || sig2.IsDistributed) {
3099-
if (sig1.IsAsyncFunction != sig2.IsAsyncFunction)
3100-
return true;
3101-
} else {
3102-
// Otherwise one is an async function and the other is not, they don't conflict.
3098+
if (!sig1.IsDistributed && !sig2.IsDistributed) {
3099+
// For non-distributed functions,
3100+
// if one is an async function and the other is not, they don't conflict.
31033101
if (sig1.IsAsyncFunction != sig2.IsAsyncFunction)
31043102
return false;
3105-
}
3103+
} // else, if any of the methods was distributed, continue checking
31063104

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

0 commit comments

Comments
 (0)