mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CS] Be more defensive in isIUOWrappedInParens() check
This commit is contained in:
@@ -2199,13 +2199,18 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
|
||||
if (!type || !type->is<AnyFunctionType>())
|
||||
return false;
|
||||
|
||||
if (auto call = dyn_cast<CallExpr>(locator->getAnchor()))
|
||||
return call->getSemanticFn() != call->getFn();
|
||||
auto expr = locator->getAnchor();
|
||||
if (!expr)
|
||||
return false;
|
||||
|
||||
if (auto paren = getParentExpr(locator->getAnchor())) {
|
||||
return isa<ParenExpr>(paren);
|
||||
if (isa<CallExpr>(expr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto parentExpr = getParentExpr(expr);
|
||||
if (parentExpr && isa<ParenExpr>(parentExpr))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user