mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Sema] Allow associated type inference to skip @Sendable on ObjC witnesses
Witness checking itself is allowed to skip `@Sendable` mismatch in this situation. This is a narrow fix for `SendableCompletionHandlers` feature to make sure that the behavior doesn't change for non-ObjC witnesses
This commit is contained in:
@@ -375,7 +375,8 @@ private:
|
||||
if (firstFunc->isNoEscape() != secondFunc->isNoEscape())
|
||||
return mismatch(firstFunc.getPointer(), secondFunc, sugaredFirstType);
|
||||
|
||||
if (firstFunc->isSendable() != secondFunc->isSendable())
|
||||
if (!Matcher.asDerived().allowSendableFunctionMismatch() &&
|
||||
firstFunc->isSendable() != secondFunc->isSendable())
|
||||
return mismatch(firstFunc.getPointer(), secondFunc, sugaredFirstType);
|
||||
|
||||
auto sugaredFirstFunc = sugaredFirstType->castTo<AnyFunctionType>();
|
||||
@@ -554,6 +555,8 @@ private:
|
||||
|
||||
bool alwaysMismatchTypeParameters() const { return false; }
|
||||
|
||||
bool allowSendableFunctionMismatch() const { return false; }
|
||||
|
||||
void pushPosition(Position pos) {}
|
||||
void popPosition(Position pos) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user