Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java

Issue 14569025: Report CompileTimeErrorCode.REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4c26b74473c94c86c747ebced20128afdb732d02..cabf2d2fb36cb1ec9eef2cceb06e4931c3e4b35c 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
@@ -1274,6 +1274,45 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_referenceToDeclaredVariableInInitializer_constructorName() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " A.x() {}",
+ "}",
+ "f() {",
+ " var x = new A.x();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_referenceToDeclaredVariableInInitializer_methodName() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " x() {}",
+ "}",
+ "f(A a) {",
+ " var x = a.x();",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
+ public void test_referenceToDeclaredVariableInInitializer_propertyName() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " var x;",
+ "}",
+ "f(A a) {",
+ " var x = a.x;",
+ "}"));
+ resolve(source);
+ assertNoErrors();
+ verify(source);
+ }
+
public void test_rethrowOutsideCatch() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698