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

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

Issue 24268002: Fix bug in the closure methods, where iterating over the boxed variable did not return the variable… (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/simple_types_inferrer.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_closure_test.dart
===================================================================
--- tests/compiler/dart2js/simple_inferrer_closure_test.dart (revision 27646)
+++ tests/compiler/dart2js/simple_inferrer_closure_test.dart (working copy)
@@ -83,6 +83,16 @@
return a;
}
+returnIntOrNull() {
+ for (var b in [42]) {
+ var bar = 42;
+ f() => bar;
+ bar = null;
+ return f();
+ }
+ return 42;
+}
+
class A {
foo() {
f() => this;
@@ -99,6 +109,7 @@
returnDyn3();
returnInt4();
returnNum1();
+ returnIntOrNull();
new A().foo();
}
""";
@@ -120,6 +131,7 @@
checkReturn('returnInt2', compiler.typesTask.intType);
checkReturn('returnInt3', compiler.typesTask.intType);
checkReturn('returnInt4', compiler.typesTask.intType);
+ checkReturn('returnIntOrNull', compiler.typesTask.intType.nullable());
checkReturn('returnDyn1', compiler.typesTask.dynamicType.nonNullable());
checkReturn('returnDyn2', compiler.typesTask.dynamicType.nonNullable());
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698