@@ -227,24 +227,24 @@ class TypeVariableRefFinder : public ASTWalker {
227
227
}
228
228
};
229
229
230
- // / Find any references to not yet resolved outer closure parameters
231
- // / used in the body of the inner closure. This is required because
230
+ // / Find any references to not yet resolved outer VarDecls (including closure
231
+ // / parameters) used in the body of the inner closure. This is required because
232
232
// / isolated conjunctions, just like single-expression closures, have
233
233
// / to be connected to type variables they are going to use, otherwise
234
234
// / they'll get placed in a separate solver component and would never
235
235
// / produce a solution.
236
- class UnresolvedClosureParameterCollector : public ASTWalker {
236
+ class UnresolvedVarCollector : public ASTWalker {
237
237
ConstraintSystem &CS;
238
238
239
239
llvm::SmallSetVector<TypeVariableType *, 4 > Vars;
240
240
241
241
public:
242
- UnresolvedClosureParameterCollector (ConstraintSystem &cs) : CS(cs) {}
242
+ UnresolvedVarCollector (ConstraintSystem &cs) : CS(cs) {}
243
243
244
244
PreWalkResult<Expr *> walkToExprPre (Expr *expr) override {
245
245
if (auto *DRE = dyn_cast<DeclRefExpr>(expr)) {
246
246
auto *decl = DRE->getDecl ();
247
- if (isa<ParamDecl >(decl)) {
247
+ if (isa<VarDecl >(decl)) {
248
248
if (auto type = CS.getTypeIfAvailable (decl)) {
249
249
if (auto *typeVar = type->getAs <TypeVariableType>()) {
250
250
Vars.insert (typeVar);
@@ -342,7 +342,7 @@ static void createConjunction(ConstraintSystem &cs,
342
342
isIsolated = true ;
343
343
}
344
344
345
- UnresolvedClosureParameterCollector paramCollector (cs);
345
+ UnresolvedVarCollector paramCollector (cs);
346
346
347
347
for (const auto &entry : elements) {
348
348
ASTNode element = std::get<0 >(entry);
0 commit comments