Index: pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart |
diff --git a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart |
index 6ba0afa8c4440fe019931f7b9761aa369236de90..9032b05bd848d0078d81296fdaefe0f599731354 100644 |
--- a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart |
+++ b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart |
@@ -160,7 +160,10 @@ abstract class LocalDeclarationVisitor extends GeneralizingAstVisitor { |
id = node.identifier; |
type = null; |
} |
- declaredLocalVar(id, type); |
+ if (id != null) { |
+ // If there is no loop variable, don't declare it. |
+ declaredLocalVar(id, type); |
+ } |
visitNode(node); |
} |