File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -2355,23 +2355,23 @@ bool TypeChecker::typeCheckBinding(
2355
2355
if (!initializer->getType ())
2356
2356
initializer->setType (ErrorType::get (Context));
2357
2357
2358
- // If the type of the pattern is inferred, assign error types to the pattern
2359
- // and its variables, to prevent it from being referenced by the constraint
2360
- // system.
2358
+ // Assign error types to the pattern and its variables, to prevent it from
2359
+ // being referenced by the constraint system.
2361
2360
if (patternType->hasUnresolvedType () ||
2362
2361
patternType->hasUnboundGenericType ()) {
2363
2362
pattern->setType (ErrorType::get (Context));
2364
- pattern->forEachVariable ([&](VarDecl *var) {
2365
- // Don't change the type of a variable that we've been able to
2366
- // compute a type for.
2367
- if (var->hasInterfaceType () &&
2368
- !var->getType ()->hasUnboundGenericType () &&
2369
- !var->isInvalid ())
2370
- return ;
2371
-
2372
- var->setInvalid ();
2373
- });
2374
2363
}
2364
+
2365
+ pattern->forEachVariable ([&](VarDecl *var) {
2366
+ // Don't change the type of a variable that we've been able to
2367
+ // compute a type for.
2368
+ if (var->hasInterfaceType () &&
2369
+ !var->getType ()->hasUnboundGenericType () &&
2370
+ !var->isInvalid ())
2371
+ return ;
2372
+
2373
+ var->setInvalid ();
2374
+ });
2375
2375
return true ;
2376
2376
}
2377
2377
You can’t perform that action at this time.
0 commit comments