Chromium Code Reviews| Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java |
| diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java |
| index a7c3fa5ef40382c0d9c4b32aa8c43ac35f306786..51e82754187ecfc287b3117bf960ae3b1948eae5 100644 |
| --- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java |
| +++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java |
| @@ -409,6 +409,32 @@ public class StaticWarningCodeTest extends ResolverTestCase { |
| verify(source); |
| } |
| + public void test_assignmentToConst_instanceVariable() throws Exception { |
| + Source source = addSource(createSource(// |
| + "class A {", |
| + " static const v = 0;", |
| + "}", |
| + "f() {", |
| + " A a = new A();", |
| + " a.v = 1;", |
| + "}")); |
| + resolve(source); |
| + assertErrors(StaticWarningCode.ASSIGNMENT_TO_CONST); |
| + verify(source); |
| + } |
| + |
| + // TODO(scheglov) |
|
jwren
2013/08/01 16:57:54
TODO?
|
| + public void test_assignmentToConst_localVariable() throws Exception { |
| + Source source = addSource(createSource(// |
| + "f() {", |
| + " const x = 0;", |
| + " x = 1;", |
| + "}")); |
| + resolve(source); |
| + assertErrors(StaticWarningCode.ASSIGNMENT_TO_CONST); |
| + verify(source); |
| + } |
| + |
| public void test_assignmentToFinal_instanceVariable() throws Exception { |
| Source source = addSource(createSource(// |
| "class A {", |