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

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

Issue 10854030: Issue 4400. Fix for using top-level field in instance field initializer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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/CompileTimeConstantAnalyzer.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/CompileTimeConstantTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java b/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
index 1a7bf906a25be265b73fad1cf46812fb2171248c..5a84fa6b0eefa8b3649e58fb94381a0897ea85a1 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
@@ -58,7 +58,7 @@ public class CompileTimeConstantTest extends ResolverTestCase {
" var f = new Object();",
"}"));
}
-
+
/**
* We can not reference "this" directly or indirectly as reference to other fields.
* <p>
@@ -87,6 +87,22 @@ public class CompileTimeConstantTest extends ResolverTestCase {
}
/**
+ * We can reference top-level fields, because they are static.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=4400
+ */
+ public void test_instanceVariable_nonConstInitializer_topLevelField() {
+ resolveAndTestCtConstExpectErrors(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class Object {}",
+ "final TOP = 1;",
+ "class A {",
+ " var f = TOP;",
+ "}",
+ ""));
+ }
+
+ /**
* <p>
* http://code.google.com/p/dart/issues/detail?id=1655
*/
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698