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

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

Issue 14856021: Report UNDEFINED_CONSTRUCTOR_IN_INITIALIZER and others (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index 3c3fcd8be39c9b698c2049e36223024333710e01..c1770dd5beefb6949a3840d6342a3c9a2db695a2 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -1161,6 +1161,20 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonGenerativeConstructor() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A.named() {}",
+ " factory A() {}",
+ "}",
+ "class B extends A {",
+ " B() : super.named();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
public void test_nonTypeInCatchClause_isClass() throws Exception {
Source source = addSource(createSource(//
"f() {",
@@ -1476,6 +1490,57 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_undefinedConstructorInInitializer_explicit_named() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A.named() {}",
+ "}",
+ "class B extends A {",
+ " B() : super.named();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_undefinedConstructorInInitializer_explicit_unnamed() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A() {}",
+ "}",
+ "class B extends A {",
+ " B() : super();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_undefinedConstructorInInitializer_implicit() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A() {}",
+ "}",
+ "class B extends A {",
+ " B();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_undefinedConstructorInInitializer_implicit_typedef() throws Exception {
+ Source source = addSource(createSource(//
+ "class M {}",
+ "typedef A = Object with M;",
+ "class B extends A {",
+ " B();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
public void test_undefinedGetter_noSuchMethod_getter() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698