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

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

Issue 17581003: Report NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT as CTEC. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: tweaks Created 7 years, 6 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 2c1df0d1e4f350b7a4c86b8475ace39b545a6ad5..a9b6111562cbbcfe1eead756dd813dc5c05a362d 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
@@ -936,7 +936,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
resolve(source);
assertErrors(
CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
- StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
+ CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
verify(source);
}
@@ -946,7 +946,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
resolve(source);
assertErrors(
CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
- StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
+ CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
verify(source);
}
@@ -956,7 +956,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
resolve(source);
assertErrors(
CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
- StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
+ CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
verify(source);
}
@@ -966,7 +966,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
resolve(source);
assertErrors(
CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
- StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
+ CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
verify(source);
}
@@ -976,7 +976,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
resolve(source);
assertErrors(
CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS,
- StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
+ CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
verify(source);
}
@@ -1970,6 +1970,40 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_noDefaultSuperConstructorExplicit() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A(p);",
+ "}",
+ "class B extends A {",
+ " B() {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT);
+ verify(source);
+ }
+
+ public void test_noDefaultSuperConstructorImplicit_superHasParameters() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A(p);",
+ "}",
+ "class B extends A {",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
+ verify(source);
+ }
+
+ public void test_noDefaultSuperConstructorImplicit_superOnlyNamed() throws Exception {
+ Source source = addSource(createSource(//
+ "class A { A.named() {} }",
+ "class B extends A {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT);
+ verify(source);
+ }
+
public void test_nonConstantDefaultValue_function_named() throws Exception {
Source source = addSource(createSource(//
"int y;",
@@ -2207,6 +2241,18 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonGenerativeConstructor_implicit2() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " factory A() {}",
+ "}",
+ "class B extends A {",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR);
+ verify(source);
+ }
+
public void test_notEnoughRequiredArguments_const() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698