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

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

Issue 18772003: Report RESULT_NUM when constant value is String + String. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 428b73617ab9af9736c79e690595a2f2e8e1cffa..6d11c39a5e40cadcabd7e1750ac3ea504c58ddbf 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
@@ -683,6 +683,13 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
check_constEvalTypeNum_withParameter_binary("p % ''");
}
+ public void test_constEvalTypeNum_plus_String() throws Exception {
+ Source source = addSource("const C = 'a' + 'b';");
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
+ verify(source);
+ }
+
public void test_constFormalParameter_fieldFormalParameter() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -2498,7 +2505,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
" const A(String p) : a = p && true;",
"}"));
resolve(source);
- assertErrors(CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER);
+ assertErrors(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
verify(source);
}
@@ -2509,7 +2516,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
" const A(String p) : a = true && p;",
"}"));
resolve(source);
- assertErrors(CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER);
+ assertErrors(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
verify(source);
}
@@ -2521,7 +2528,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
"}"));
resolve(source);
assertErrors(
- CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER,
+ CompileTimeErrorCode.CONST_EVAL_TYPE_INT,
CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
verify(source);
}
@@ -2534,7 +2541,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
"}"));
resolve(source);
assertErrors(
- CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER,
+ CompileTimeErrorCode.CONST_EVAL_TYPE_NUM,
CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
verify(source);
}

Powered by Google App Engine
This is Rietveld 408576698