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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java

Issue 12045040: Issue 7633. Report error when instance field is accessed from factory constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9333042cf508734ec25c03b00513f886e1862f25..5e171c63f46026f3723b4e4f6a94b8fcd5f561c4 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java
@@ -1181,4 +1181,23 @@ public class NegativeResolverTest extends CompilerTestCase {
""),
errEx(ResolverErrorCode.ILLEGAL_FIELD_ACCESS_FROM_STATIC, 5, 12, 5));
}
+
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=7633
+ */
+ public void test_accessInstanceField_fromConstFactory() throws Exception {
+ checkSourceErrors(
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " var foo;",
+ " factory A() {",
+ " var v = foo;",
+ " return null;",
+ " }",
+ "}",
+ ""),
+ errEx(ResolverErrorCode.ILLEGAL_FIELD_ACCESS_FROM_FACTORY, 5, 13, 3));
+ }
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698