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 9740ce326d412f45116058041accb757df2c8416..e15858a597f3e64126a145dcd7f46dffcc4b1471 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 |
@@ -640,6 +640,22 @@ public class StaticWarningCodeTest extends ResolverTestCase { |
verify(source); |
} |
+ public void test_assignmentToFinal_excludedSetter() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var v;", |
+ "}", |
+ "class B extends A {", |
+ " final v = 0;", |
+ "}", |
+ "main() {", |
+ " new B().v = 1;", |
+ "}")); |
+ resolve(source); |
+ assertErrors(source, StaticWarningCode.ASSIGNMENT_TO_FINAL); |
+ verify(source); |
+ } |
+ |
public void test_assignmentToFinal_instanceVariable() throws Exception { |
Source source = addSource(createSource(// |
"class A {", |
@@ -1713,6 +1729,19 @@ public class StaticWarningCodeTest extends ResolverTestCase { |
verify(source); |
} |
+ public void test_nonAbstractClassInheritsAbstractMemberOne_setter_excluded() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " final int x = 0;", |
+ "}", |
+ "class B implements A {", |
+ " int get x => 42;", |
+ "}")); |
+ resolve(source); |
+ assertErrors(source, StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE); |
Brian Wilkerson
2013/10/09 19:57:48
Sorry, but I'm not understanding why there is a wa
scheglov
2013/10/09 20:04:00
The most recent spec:
------------
A final or cons
Brian Wilkerson
2013/10/09 20:20:54
Ah! I missed the 'implements' (I think I read 'ext
|
+ verify(source); |
+ } |
+ |
public void test_nonAbstractClassInheritsAbstractMemberOne_setter_fromInterface() |
throws Exception { |
Source source = addSource(createSource(// |