Chromium Code Reviews| Index: tests/language/static_field_test.dart |
| diff --git a/tests/language/static_field_test.dart b/tests/language/static_field_test.dart |
| index 3b8ce18768da321a47826bed9ea5a13fcf0ee27b..93e15ba53cc28cdde065041d2748b4349c5e0cab 100644 |
| --- a/tests/language/static_field_test.dart |
| +++ b/tests/language/static_field_test.dart |
| @@ -62,7 +62,49 @@ class StaticFieldTest { |
| } |
| +class StaticField1RunNegativeTest { |
| + static /// 01: static type warning, runtime error |
| + var x; |
| + static testMain() { |
| + var foo = new StaticField1RunNegativeTest(); |
|
ahe
2012/06/13 14:27:24
Here I would say:
print(x);
to make sure x is "c
zundel
2012/06/13 15:15:43
Done.
|
| + var x = foo.x; |
|
ahe
2012/06/13 14:27:24
I would put the /// comment on this line.
Also, I
zundel
2012/06/13 15:15:43
Got rid of the shadowing, but left the other in pl
|
| + } |
| +} |
| + |
| +class StaticField1aRunNegativeTest { |
| + static /// 02: static type warning, runtime error |
| + void m() {} |
| + |
| + static testMain() { |
| + var foo = new StaticField1aRunNegativeTest(); |
| + var m = foo.m; |
|
ahe
2012/06/13 14:27:24
Ditto. For all three remarks above.
|
| + } |
| +} |
| + |
| +class StaticField2RunNegativeTest { |
| + static /// 03: static type warning, runtime error |
| + var x; |
| + |
| + static testMain() { |
| + var foo = new StaticField2RunNegativeTest(); |
| + foo.x = 1; |
|
ahe
2012/06/13 14:27:24
Ditto (all three).
|
| + } |
| +} |
| + |
| +class StaticField2aRunNegativeTest { |
| + static void m() {} /// 04: static type warning, runtime error |
| + |
| + static testMain() { |
| + var foo = new StaticField2aRunNegativeTest(); |
| + foo.m = 1; /// 04:continued |
|
ahe
2012/06/13 14:27:24
Ditto (all three).
zundel
2012/06/13 15:15:43
I'm not sure the original author of this test real
|
| + } |
| +} |
| + |
| main() { |
| StaticFieldTest.testMain(); |
| InitializerTest.testStaticFieldInitialization(); |
| + StaticField1RunNegativeTest.testMain(); |
| + StaticField1aRunNegativeTest.testMain(); |
| + StaticField2RunNegativeTest.testMain(); |
| + StaticField2aRunNegativeTest.testMain(); |
| } |