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

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

Issue 280873002: Fix for issue 16423 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Missed issue number Created 6 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/StaticTypeWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
index 61fce01540cd262e2b70fa044fbf39a6904da1cf..c93ae8d49503a4a9739056681d344130639a0afc 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
@@ -432,6 +432,46 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonBoolOperand_and_left() throws Exception {
+ Source source = addSource(createSource(//
+ "bool f(int left, bool right) {",
+ " return left && right;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticTypeWarningCode.NON_BOOL_OPERAND);
+ verify(source);
+ }
+
+ public void test_nonBoolOperand_and_right() throws Exception {
+ Source source = addSource(createSource(//
+ "bool f(bool left, String right) {",
+ " return left && right;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticTypeWarningCode.NON_BOOL_OPERAND);
+ verify(source);
+ }
+
+ public void test_nonBoolOperand_or_left() throws Exception {
+ Source source = addSource(createSource(//
+ "bool f(List<int> left, bool right) {",
+ " return left || right;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticTypeWarningCode.NON_BOOL_OPERAND);
+ verify(source);
+ }
+
+ public void test_nonBoolOperand_or_right() throws Exception {
+ Source source = addSource(createSource(//
+ "bool f(bool left, double right) {",
+ " return left || right;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticTypeWarningCode.NON_BOOL_OPERAND);
+ verify(source);
+ }
+
public void test_nonTypeAsTypeArgument_notAType() throws Exception {
Source source = addSource(createSource(//
"int A;",

Powered by Google App Engine
This is Rietveld 408576698