Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Unified Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 702473002: Fix access semantics for foreach loops. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer2dart/test/identifier_semantics_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/ast.dart
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index c156ede8b9067217851a908dbbee30b6c653a05c..ddc9a1b5349765a30b906bff03c4314d6bab2c1e 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -16354,6 +16354,12 @@ class SimpleIdentifier extends Identifier {
return false;
}
}
+ if (parent is ForEachStatement) {
+ ForEachStatement stmt = parent as ForEachStatement;
+ if (identical(stmt.identifier, target)) {
+ return false;
+ }
+ }
return true;
}
@@ -16393,6 +16399,8 @@ class SimpleIdentifier extends Identifier {
return true;
} else if (parent is AssignmentExpression) {
return identical((parent as AssignmentExpression).leftHandSide, target);
+ } else if (parent is ForEachStatement) {
+ return identical((parent as ForEachStatement).identifier, target);
}
return false;
}
« no previous file with comments | « no previous file | pkg/analyzer2dart/test/identifier_semantics_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698