| 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 1c63f63be2f16ae67d5c8c9f381106701871c88b..22b66bfe35c484a63baedfc33872d776f328f3ba 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
|
| @@ -1356,6 +1356,57 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_implicitThisReferenceInInitializer_field() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " var v;",
|
| + " A() : v = f;",
|
| + " var f;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_implicitThisReferenceInInitializer_invocation() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " var v;",
|
| + " A() : v = f();",
|
| + " f() {}",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_implicitThisReferenceInInitializer_redirectingConstructorInvocation()
|
| + throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " A(p) {}",
|
| + " A() : super(f);",
|
| + " var f;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_implicitThisReferenceInInitializer_superConstructorInvocation() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " A(p) {}",
|
| + "}",
|
| + "class B extends A {",
|
| + " B() : super(f);",
|
| + " var f;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_importOfNonLibrary() throws Exception {
|
| Source source = addSource(createSource(//
|
| "library lib;",
|
|
|