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

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

Issue 17583005: Report CONST_EVAL_TYPE_BOOL when left operand of || is 'true'. (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 6cd8bf7827b2cbec2839d989b11f1a7139a16340..2c1df0d1e4f350b7a4c86b8475ace39b545a6ad5 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
@@ -559,6 +559,13 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
check_constEvalTypeBool_withParameter_binary("p || ''");
}
+ public void test_constEvalTypeBool_binary_leftTrue() throws Exception {
+ Source source = addSource("const C = (true || 0);");
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
+ verify(source);
+ }
+
public void test_constEvalTypeBoolNumString_equal() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698