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

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 1040083007: do not report _ as unused variable (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 9 months 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 | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 4f24b3abe76efdf10461c06f6cef44bfdcb0349f..7ba6e181e6ac64c29e865b4904f67c8358d014cd 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -4220,6 +4220,21 @@ print(x) {}''');
verify([source]);
}
+ void test_unusedLocalVariable_inFor_underscore_ignored() {
+ enableUnusedLocalVariable = true;
+ Source source = addSource(r'''
+main() {
+ for (var _ in [1,2,3]) {
+ for (var __ in [4,5,6]) {
+ // do something
+ }
+ }
+}''');
+ resolve(source);
+ assertErrors(source);
+ verify([source]);
+ }
+
void test_unusedLocalVariable_inFunction() {
enableUnusedLocalVariable = true;
Source source = addSource(r'''
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698