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

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

Issue 9052002: Issue 999: NPE from CompileTimeConstantAnalyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleanup of ErrorExpectation + static imports Created 9 years 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 00f462c0c001f8f5a8a991e9354f0df8a5e074d2..d037649d2b59ac136fe9cda8e90c9b0c8062c9a3 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java
@@ -5,6 +5,7 @@
package com.google.dart.compiler.resolver;
import com.google.common.base.Joiner;
+import static com.google.dart.compiler.common.ErrorExpectation.errEx;
@@ -499,4 +500,16 @@ public class CompileTimeConstantTest extends ResolverTestCase {
" static final value3 = 8;",
"}"));
}
+
+ public void testInvalidDefaultParameterWithField() {
+ resolveAndTestCtConstExpectErrors(
+ Joiner.on("\n").join(
+ "class Object {}",
+ "class Function {}",
+ "Function get topLevelGetter() => () {};",
+ "topLevel([var x = topLevelGetter]) { x(); }",
+ "main() { topLevel(); }"),
+ errEx(ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION, 4, 19, 14),
+ errEx(ResolverErrorCode.EXPECTED_CONSTANT_EXPRESSION, 3, 1, 39));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698