| 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 cf275109ab793a47881c3940f0ce23eeac086574..d6741988e0c0ab6be38ca9037b6b59b771b0c231 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
|
| @@ -601,6 +601,21 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_constInitializedWithNonConstValueFromDeferredClass() throws Exception {
|
| + addNamedSource("/lib1.dart", createSource(//
|
| + "library lib1;",
|
| + "const V = 1;"));
|
| + Source source = addSource(createSource(//
|
| + "library root;",
|
| + "import 'lib1.dart' deferred as a;",
|
| + "const B = a.V;"));
|
| + resolve(source);
|
| + assertErrors(
|
| + source,
|
| + CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_constInstanceField() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class C {",
|
| @@ -2076,6 +2091,21 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| assertErrors(source, CompileTimeErrorCode.INVALID_ANNOTATION);
|
| }
|
|
|
| + public void test_invalidAnnotationFromDeferredLibrary() throws Exception {
|
| + // See test_invalidAnnotation_notConstantVariable
|
| + addNamedSource("/lib1.dart", createSource(//
|
| + "library lib1;",
|
| + "class V { const V(); }",
|
| + "const v = const V();"));
|
| + Source source = addSource(createSource(//
|
| + "library root;",
|
| + "import 'lib1.dart' deferred as a;",
|
| + "@a.v main () {}"));
|
| + resolve(source);
|
| + assertErrors(source, CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_invalidConstructorName_notEnclosingClassName_defined() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class A {",
|
| @@ -2795,6 +2825,19 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_nonConstantDefaultValueFromDeferredLibrary() throws Exception {
|
| + addNamedSource("/lib1.dart", createSource(//
|
| + "library lib1;",
|
| + "const V = 1;"));
|
| + Source source = addSource(createSource(//
|
| + "library root;",
|
| + "import 'lib1.dart' deferred as a;",
|
| + "f({x : a.V}) {}"));
|
| + resolve(source);
|
| + assertErrors(source, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_nonConstCaseExpression() throws Exception {
|
| Source source = addSource(createSource(//
|
| "f(int p, int q) {",
|
|
|