| Index: compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
|
| index 85e5240710eb20d89e07fe1e1cdee5269e845a02..ca20d652504dbab6396373808095fa75925a00d6 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
|
| @@ -1074,4 +1074,18 @@ public class NegativeResolverTest extends CompilerTestCase {
|
| "class MyClass implements Map<Object, Dynamic> {",
|
| "}"));
|
| }
|
| +
|
| + public void testInitializerReferenceToThis() throws Exception {
|
| + checkSourceErrors(
|
| + makeCode(
|
| + "class A {",
|
| + " var x, y;",
|
| + " A.one(z) : x = z, y = this.x;",
|
| + " A.two(this.x) : y = (() { return this; });",
|
| + " A.three(this.x) : y = this.x;",
|
| + "}"),
|
| + errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 3, 25, 4),
|
| + errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 4, 36, 4),
|
| + errEx(ResolverErrorCode.THIS_IN_INITIALIZER_AS_EXPRESSION, 5, 25, 4));
|
| + }
|
| }
|
|
|