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

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

Issue 14861012: Report CTEC.CONST_WITH_NON_CONSTANT_ARGUMENT (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 cb7fe3d1690ae827c91fd0fa4e1cf4188638e694..c8ea416265381284b955bc9c8e4258c3de70e3df 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
@@ -29,17 +29,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void fail_constWithNonConstantArgument() throws Exception {
- Source source = addSource(createSource(//
- "class T {",
- " T(a) {};",
- "}",
- "f(p) { return const T(p); }"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT);
- verify(source);
- }
-
public void fail_constWithTypeParameters() throws Exception {
Source source = addSource(createSource(//
// TODO
@@ -904,6 +893,17 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_constWithNonConstantArgument() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " const A(a) {};",
+ "}",
+ "f(p) { return const A(p); }"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT);
+ verify(source);
+ }
+
public void test_constWithNonType() throws Exception {
Source source = addSource(createSource(//
"int A;",

Powered by Google App Engine
This is Rietveld 408576698