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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java

Issue 17637004: Report CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE for invalid prefixed identifier. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 444fb9e5a03f8e71173629e7ff03256f880726bb..95f6b60d262a49f6bab3b725c78b5fa3d16b571f 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -582,6 +582,32 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_constEval_propertyExtraction_methodInstance() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " const A();",
+ " m() {}",
+ "}",
+ "final a = const A();",
+ "const C = a.m;"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
+ verify(source);
+ }
+
+ public void test_constEval_propertyExtraction_methodStatic_targetInstance() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " const A();",
+ " static m() {}",
+ "}",
+ "final a = const A();",
+ "const C = a.m;"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);
+ verify(source);
+ }
+
public void test_constEvalThrowsException_binaryMinus_null() throws Exception {
check_constEvalThrowsException_binary_null("null - 5", false);
check_constEvalThrowsException_binary_null("5 - null", true);

Powered by Google App Engine
This is Rietveld 408576698