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

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

Issue 15409004: Update CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD to check also super/mixin types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move hasNonFinalField() to ClassElement Created 7 years, 7 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/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 1c63f63be2f16ae67d5c8c9f381106701871c88b..952953413f2aab9f1a17d683ab1d6923aa3ee64b 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -650,7 +650,33 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_constConstructorWithNonFinalField() throws Exception {
+ public void test_constConstructorWithNonFinalField_mixin() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " var a;",
+ "}",
+ "class B extends Object with A {",
+ " const B() {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD);
+ verify(source);
+ }
+
+ public void test_constConstructorWithNonFinalField_super() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " var a;",
+ "}",
+ "class B extends A {",
+ " const B() {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD);
+ verify(source);
+ }
+
+ public void test_constConstructorWithNonFinalField_this() throws Exception {
Source source = addSource(createSource(//
"class A {",
" int x;",

Powered by Google App Engine
This is Rietveld 408576698