Skip to content

Commit 14e2a16

Browse files
committed
[CSOptimizer] Don't attempt to optimize calls with code completion token(s) in argument position
1 parent bc5f70a commit 14e2a16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Sema/CSOptimizer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ static void determineBestChoicesInContext(
112112
auto argFuncType =
113113
applicableFn.get()->getFirstType()->getAs<FunctionType>();
114114

115+
auto argumentList = cs.getArgumentList(applicableFn.get()->getLocator());
116+
if (!argumentList || cs.containsIDEInspectionTarget(argumentList))
117+
return;
118+
115119
SmallVector<SmallVector<std::pair<Type, /*fromLiteral=*/bool>, 2>, 2>
116120
candidateArgumentTypes;
117121
candidateArgumentTypes.resize(argFuncType->getNumParams());

0 commit comments

Comments
 (0)