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 c8286da06a5fd2f26f4f72029dd1d43aec6e2a42..d7eb310ac66e1ce1afd8903e1c668a825607750b 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 |
@@ -545,6 +545,159 @@ public class NonErrorResolverTest extends ResolverTestCase { |
verify(source); |
} |
+ public void test_implicitThisReferenceInInitializer_constructorName() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " A.named() {}", |
+ "}", |
+ "class B {", |
+ " var v;", |
+ " B() : v = new A.named();", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_prefixedIdentifier() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var f;", |
+ "}", |
+ "class B {", |
+ " var v;", |
+ " B(A a) : v = a.f;", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_qualifiedMethodInvocation() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " f() {}", |
+ "}", |
+ "class B {", |
+ " var v;", |
+ " B() : v = new A().f();", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_qualifiedPropertyAccess() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var f;", |
+ "}", |
+ "class B {", |
+ " var v;", |
+ " B() : v = new A().f;", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_staticField_superClass() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " static var f;", |
+ "}", |
+ "class B extends A {", |
+ " var v;", |
+ " B() : v = f;", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_staticField_thisClass() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var v;", |
+ " A() : v = f;", |
+ " static var f;", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_staticGetter() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var v;", |
+ " A() : v = f;", |
+ " static get f => 42;", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_staticMethod() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var v;", |
+ " A() : v = f();", |
+ " static f() => 42;", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_topLevelField() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var v;", |
+ " A() : v = f;", |
+ "}", |
+ "var f = 42;")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_topLevelFunction() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var v;", |
+ " A() : v = f();", |
+ "}", |
+ "f() => 42;")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_topLevelGetter() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A {", |
+ " var v;", |
+ " A() : v = f;", |
+ "}", |
+ "get f = >42;")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
+ public void test_implicitThisReferenceInInitializer_typeVariable() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class A<T> {", |
+ " var v;", |
+ " A(p) : v = (p is T);", |
+ "}")); |
+ resolve(source); |
+ assertNoErrors(); |
+ verify(source); |
+ } |
+ |
public void test_importDuplicatedLibraryName() throws Exception { |
Source source = addSource(createSource(// |
"library test;", |