Skip to content

Commit 252fa1b

Browse files
committed
Make ErrorType DeclRefExprs for ErrorType Decls
This prevents one invalid declaration from causing cascades of subsequent errors. Fixes: * test/NameBinding/scope_map_lookup.swift * test/decl/var/variables.swift
1 parent 9e50c5f commit 252fa1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/CSGen.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,8 +1352,10 @@ namespace {
13521352
// We may, alternatively, want to use a type variable in that case,
13531353
// and possibly infer the type of the variable that way.
13541354
CS.getTypeChecker().validateDecl(E->getDecl());
1355-
if (E->getDecl()->isInvalid())
1355+
if (E->getDecl()->isInvalid()) {
1356+
E->setType(E->getDecl()->getInterfaceType());
13561357
return nullptr;
1358+
}
13571359

13581360
auto locator = CS.getConstraintLocator(E);
13591361

0 commit comments

Comments
 (0)