mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Don't diagnose forward references to debugger variables in pre-checking
This commit is contained in:
@@ -380,6 +380,10 @@ Expr *TypeChecker::resolveDeclRefExpr(UnresolvedDeclRefExpr *UDRE,
|
||||
|
||||
ValueDecl *localDeclAfterUse = nullptr;
|
||||
auto isValid = [&](ValueDecl *D) {
|
||||
// References to variables injected by lldb are always valid.
|
||||
if (isa<VarDecl>(D) && cast<VarDecl>(D)->isDebuggerVar())
|
||||
return true;
|
||||
|
||||
// If we find something in the current context, it must be a forward
|
||||
// reference, because otherwise if it was in scope, it would have
|
||||
// been returned by the call to ASTScope::lookupLocalDecls() above.
|
||||
|
||||
Reference in New Issue
Block a user