Skip to content

Commit 5219113

Browse files
committed
[Sema] Remove on-demand ParamDecl checking for closures
Because they should have been type checked before the request.
1 parent 01c4df8 commit 5219113

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,21 +2234,10 @@ InterfaceTypeRequest::evaluate(Evaluator &eval, ValueDecl *D) const {
22342234
}
22352235
}
22362236

2237-
if (PD->getTypeRepr()) {
2238-
return validateParameterType(PD);
2239-
}
2237+
if (!PD->getTypeRepr())
2238+
return Type();
22402239

2241-
// Try type checking the closure if it hasn't.
2242-
if (auto *closure = dyn_cast<ClosureExpr>(PD->getDeclContext())) {
2243-
if (!closure->getType() && !closure->hasSingleExpressionBody()) {
2244-
swift::typeCheckASTNodeAtLoc(closure->getParent(), closure->getLoc());
2245-
if (PD->hasInterfaceType())
2246-
return PD->getInterfaceType();
2247-
}
2248-
}
2249-
2250-
// Failed.
2251-
return Type();
2240+
return validateParameterType(PD);
22522241
}
22532242

22542243
case DeclKind::Var: {

0 commit comments

Comments
 (0)