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

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

Issue 10536164: Issue 3550. Initial understanding "const". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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: 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 c6d8b994c513f52069e50efc6c234c77e2ed7de6..79e43e4cbfe6f38be96eb7d271ef37408c14e29a 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
@@ -15,6 +15,25 @@ import com.google.common.base.Joiner;
*/
public class CompileTimeConstantTest extends ResolverTestCase {
+ /**
+ * We should understand "const" keyword and temporary treat both "const" and "static final" as
+ * constants.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=3550
+ */
+ public void test_temporaryConstSyntax() {
+ resolveAndTestCtConst(Joiner.on("\n").join(
+ "class Object {}",
+ "const CT = 5;",
+ "class A {",
+ " const CF = 5;",
+ " const C1 = CT + 1;",
+ " const C2 = CF + 1;",
+ " static final SF1 = CT + 1;",
+ " static final SF2 = CF + 1;",
+ "}"));
+ }
+
public void testConstantBinaryExpression1() {
resolveAndTestCtConst(Joiner.on("\n").join(
"class Object {}",

Powered by Google App Engine
This is Rietveld 408576698