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

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

Issue 23496048: Add additional hints to the analyzer to catch the 'x is double' dart2js bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase to latest & merge Created 7 years, 3 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/HintCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/HintCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/HintCodeTest.java
index ebb3ac129c7f1042c32487775de2ebd16fc6e378..c207ccbe13129db5bb900177957606e0a31b9338 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/HintCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/HintCodeTest.java
@@ -297,6 +297,38 @@ public class HintCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_isDouble() throws Exception {
+ Source source = addSource(createSource(//
+ "var v = 1 is double;"));
+ resolve(source);
+ assertErrors(source, HintCode.IS_DOUBLE);
+ verify(source);
+ }
+
+ public void test_isInt() throws Exception {
+ Source source = addSource(createSource(//
+ "var v = 1 is int;"));
+ resolve(source);
+ assertErrors(source, HintCode.IS_INT);
+ verify(source);
+ }
+
+ public void test_isNotDouble() throws Exception {
+ Source source = addSource(createSource(//
+ "var v = 1 is! double;"));
+ resolve(source);
+ assertErrors(source, HintCode.IS_NOT_DOUBLE);
+ verify(source);
+ }
+
+ public void test_isNotInt() throws Exception {
+ Source source = addSource(createSource(//
+ "var v = 1 is! int;"));
+ resolve(source);
+ assertErrors(source, HintCode.IS_NOT_INT);
+ verify(source);
+ }
+
public void test_unusedImport() throws Exception {
Source source = addSource(createSource(//
"library L;",

Powered by Google App Engine
This is Rietveld 408576698