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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java

Issue 26746002: Issue 13918. final fields induce setters that are illegal to call (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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(//

Powered by Google App Engine
This is Rietveld 408576698