Skip to content

Commit 32cfd5b

Browse files
committed
[CS] Only check if the decl has a function type
1 parent 6797148 commit 32cfd5b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,6 +2193,11 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
21932193
// then we need to only create a single constraint that binds the
21942194
// type to an optional.
21952195
auto isIUOCallWrappedInParens = [&]() {
2196+
auto decl = choice.getDecl();
2197+
auto type = decl ? decl->getInterfaceType() : nullptr;
2198+
if (!type || !type->is<AnyFunctionType>())
2199+
return false;
2200+
21962201
auto paren = getParentExpr(locator->getAnchor());
21972202
auto result = paren ? isa<ParenExpr>(paren) : false;
21982203
return result;

0 commit comments

Comments
 (0)