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)); |
+ } |
} |