Skip to content

Commit 918ac8c

Browse files
committed
[CodeCompletion] Don't try to re-typecheck ClosureExpr
At the every usage of 'collectPossibleReturnTypesFromContext()', the closure must have been typechecked earlier. If the closure has no valid type at this point, there's no chance to be type-checked by re-typechecking. rdar://problem/74430478
1 parent 9c6c9a5 commit 918ac8c

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/IDE/ExprContextAnalysis.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,6 @@ void swift::ide::collectPossibleReturnTypesFromContext(
315315
}
316316

317317
if (auto ACE = dyn_cast<AbstractClosureExpr>(DC)) {
318-
// Try type checking the closure signature if it hasn't.
319-
if (!ACE->getType())
320-
swift::typeCheckASTNodeAtLoc(ACE->getParent(), ACE->getLoc());
321-
322318
// Use the type checked type if it has.
323319
if (ACE->getType() && !ACE->getType()->hasError() &&
324320
!ACE->getResultType()->hasUnresolvedType()) {

0 commit comments

Comments
 (0)