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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java

Issue 9421002: Issue 1714. Report warning if assert argument is not 'bool' or '() -> bool'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
index 87dfc73457b9bf5a0200e1ebfd7016847339c1c5..67bd0a8763d56f8a2e149f3625b80073c4177070 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
@@ -56,16 +56,14 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
public void testAssert() {
analyze("assert(true);");
analyze("assert(false);");
- analyzeFail("assert('message');",
- TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
+ analyzeFail("assert('message');", TypeErrorCode.ASSERT_BOOL);
analyze("assert(null);");
- analyzeFail("assert(1);",
- TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
+ analyzeFail("assert(1);", TypeErrorCode.ASSERT_BOOL);
analyze("assert(foo() {});");
analyze("assert(bool foo() {});");
analyze("assert(Object foo() {});");
- analyzeFail("assert(String foo() {});",
- TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
+ analyzeFail("assert(String foo() {});", TypeErrorCode.ASSERT_BOOL);
+ analyzeFail("assert(bool foo(x) {});", TypeErrorCode.ASSERT_BOOL);
}
public void testBadInitializers() {
@@ -1351,7 +1349,7 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
// analyzeFail("{ void f() {} +f(); }", TypeErrorCode.VOID);
analyzeFail("{ void f() {} var x; x == f(); }", TypeErrorCode.VOID);
analyzeFail("{ void f() {} assert(f()); }", TypeErrorCode.VOID);
- analyzeFail("{ void f() {} assert(f); }", TypeErrorCode.VOID);
+ analyzeFail("{ void f() {} assert(f); }", TypeErrorCode.ASSERT_BOOL);
analyzeFail("{ void f() {} while (f()); }", TypeErrorCode.VOID);
analyzeFail("{ void f() {}; ({ 'x': f() }); }", TypeErrorCode.VOID);
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698