| 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 24090c330ac0f38bbc478e6e6602f5117fcfd90e..e71ac170a2024175e2516096edc068783e181e53 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
|
| @@ -49,19 +49,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| - public void fail_constWithUndefinedConstructor() throws Exception {
|
| - Source source = addSource(createSource(//
|
| - "class A {",
|
| - " A(x) {}",
|
| - "}",
|
| - "f() {",
|
| - " return const A(0);",
|
| - "}"));
|
| - resolve(source);
|
| - assertErrors(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR);
|
| - verify(source);
|
| - }
|
| -
|
| public void fail_duplicateDefinition() throws Exception {
|
| Source source = addSource(createSource(//
|
| "f() {",
|
| @@ -969,6 +956,32 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_constWithUndefinedConstructor() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " const A();",
|
| + "}",
|
| + "f() {",
|
| + " return const A.noSuchConstructor();",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR);
|
| + // no verify(), 'noSuchConstructor' is not resolved
|
| + }
|
| +
|
| + public void test_constWithUndefinedConstructorDefault() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " const A.name();",
|
| + "}",
|
| + "f() {",
|
| + " return const A();",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_defaultValueInFunctionTypeAlias() throws Exception {
|
| Source source = addSource(createSource(//
|
| "typedef F([x = 0]);"));
|
|
|