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

Unified Diff: tests/compiler/dart2js/simple_inferrer_and_or_test.dart

Issue 181783006: Fix bad type-inferrence for is-checks in logical and/or expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add another test. Created 6 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
Index: tests/compiler/dart2js/simple_inferrer_and_or_test.dart
diff --git a/tests/compiler/dart2js/simple_inferrer_and_or_test.dart b/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
index 832edd5fd020e4ce178f9bc104f5560780c7350b..a964d41046f891fb67f7cc693f8093ce2fb82e43 100644
--- a/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
@@ -54,6 +54,15 @@ returnDyn7() {
return a;
}
+returnDyn8(x) => x;
+
+test8() {
+ var a = "foo";
+ if (a.length == 3) a = 52;
+ if ((false && a is! String) || returnDyn8(a)) return a;
+ return a;
+}
+
main() {
returnDyn1();
returnDyn2();
@@ -62,6 +71,7 @@ main() {
returnDyn5();
returnDyn6();
returnDyn7();
+ test8();
}
""";
@@ -89,5 +99,6 @@ void main() {
checkReturn('returnDyn6', compiler.typesTask.dynamicType.nonNullable());
checkReturn('returnDyn7', subclassOfInterceptor);
checkReturn('returnDyn7b', subclassOfInterceptor);
+ checkReturn('returnDyn8', subclassOfInterceptor);
}));
}

Powered by Google App Engine
This is Rietveld 408576698