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

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

Issue 22935003: Report CTEC.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 5663360516b12521d7664026baf303ee39e51527..79a02ee133f72c95c318a598f185099937fc4eb5 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
@@ -329,6 +329,32 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_constConstructorWithNonConstSuper_explicit() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A();",
+ "}",
+ "class B extends A {",
+ " const B(): super();",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER);
+ verify(source);
+ }
+
+ public void test_constConstructorWithNonConstSuper_implicit() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A();",
+ "}",
+ "class B extends A {",
+ " const B();",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER);
+ verify(source);
+ }
+
public void test_constConstructorWithNonFinalField_mixin() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -351,7 +377,9 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
" const B();",
"}"));
resolve(source);
- assertErrors(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD);
+ assertErrors(
+ CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
+ CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER);
verify(source);
}

Powered by Google App Engine
This is Rietveld 408576698