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

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

Issue 23816004: Is checks on the right hand side of an || used in an 'if' do not apply to the then branch of that i… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/simple_inferrer_test.dart
===================================================================
--- tests/compiler/dart2js/simple_inferrer_test.dart (revision 27124)
+++ tests/compiler/dart2js/simple_inferrer_test.dart (working copy)
@@ -234,6 +234,18 @@
}
}
+testIsCheck21(a) {
+ if (a is int || a is List) {
+ return a;
+ } else {
+ return 42;
+ }
+}
+
+testIsCheck22(a) {
+ return (a is int || a is List) ? a : 42;
+}
+
testIf1(a) {
var c = null;
if (a) {
@@ -545,6 +557,8 @@
testIsCheck18(topLevelGetter());
testIsCheck19(topLevelGetter());
testIsCheck20();
+ testIsCheck21(topLevelGetter());
+ testIsCheck22(topLevelGetter());
testIf1(topLevelGetter());
testIf2(topLevelGetter());
returnAsString();
@@ -649,6 +663,8 @@
checkReturn('testIsCheck18', typesTask.dynamicType);
checkReturn('testIsCheck19', typesTask.dynamicType);
checkReturn('testIsCheck20', typesTask.dynamicType.nonNullable());
+ checkReturn('testIsCheck21', typesTask.dynamicType);
+ checkReturn('testIsCheck22', typesTask.dynamicType);
checkReturn('testIf1', typesTask.intType.nullable());
checkReturn('testIf2', typesTask.intType.nullable());
checkReturn('returnAsString',
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698