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

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

Issue 182373002: Fix bad type-inferrence for logical expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 97531a6846a85da489047542b61f7fc5d85a6667..832edd5fd020e4ce178f9bc104f5560780c7350b 100644
--- a/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_and_or_test.dart
@@ -45,6 +45,15 @@ returnDyn6() {
return a;
}
+returnDyn7b(x) => x;
+
+returnDyn7() {
+ var a = "foo";
+ if (a.length == 3) a = 52;
+ if ((a is int) || (a is String && true)) returnDyn7b(a);
+ return a;
+}
+
main() {
returnDyn1();
returnDyn2();
@@ -52,6 +61,7 @@ main() {
returnDyn4();
returnDyn5();
returnDyn6();
+ returnDyn7();
}
""";
@@ -77,5 +87,7 @@ void main() {
checkReturn('returnDyn4', compiler.typesTask.dynamicType.nonNullable());
checkReturn('returnDyn5', compiler.typesTask.dynamicType.nonNullable());
checkReturn('returnDyn6', compiler.typesTask.dynamicType.nonNullable());
+ checkReturn('returnDyn7', subclassOfInterceptor);
+ checkReturn('returnDyn7b', subclassOfInterceptor);
}));
}

Powered by Google App Engine
This is Rietveld 408576698