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

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

Issue 11275093: Issue 5987. Report error if static const references instance const. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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: 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 ae86c276659c05c5ae5b41d87422f1c66106ba9e..34bfc17bc3b0098747d878882e091fcc84893342 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
@@ -109,6 +109,22 @@ public class CompileTimeConstantTest extends ResolverTestCase {
/**
* <p>
+ * http://code.google.com/p/dart/issues/detail?id=5987
+ */
+ public void test_referenceConstInstance_formConstStatic() throws Exception {
Brian Wilkerson 2012/11/01 13:53:28 nit: "form" --> "from"
+ resolveAndTestCtConstExpectErrors(
+ Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class Object {}",
+ "class A {",
+ " const x = 499;",
+ " static const bar = x;",
+ "}"),
+ errEx(ResolverErrorCode.NOT_A_STATIC_FIELD, 5, 22, 1));
+ }
+
+ /**
+ * <p>
* http://code.google.com/p/dart/issues/detail?id=1655
*/
public void test_constConstructor_nonConstInitializerValue() {
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698