Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 6619cc3

Browse files
author
John Messerly
committed
for loop regression test, closes #20 and #21
[email protected] Review URL: https://chromereviews.googleplex.com/139837013
1 parent d0a897f commit 6619cc3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/checker/checker_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,4 +1601,21 @@ main() {
16011601
'''
16021602
});
16031603
});
1604+
1605+
test('for loop variable', () {
1606+
testChecker({
1607+
'/main.dart': '''
1608+
foo() {
1609+
for (int i = 0; i < 10; i++) {
1610+
i = /*severe:StaticTypeError*/"hi";
1611+
}
1612+
}
1613+
bar() {
1614+
for (var i = 0; i < 10; i++) {
1615+
int j = i + 1;
1616+
}
1617+
}
1618+
'''
1619+
});
1620+
});
16041621
}

0 commit comments

Comments
 (0)