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

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

Issue 12385076: Infer types of catpured variables and use the types in the SSA builder. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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_closure_test.dart
===================================================================
--- tests/compiler/dart2js/simple_inferrer_closure_test.dart (revision 19427)
+++ tests/compiler/dart2js/simple_inferrer_closure_test.dart (working copy)
@@ -44,7 +44,7 @@
var a = 42;
if (a == 53) {
var f = () {
- a = 32;
+ return a;
};
}
return a;
@@ -60,6 +60,12 @@
return a;
}
+returnInt4() {
+ var a = 42;
+ g() { return a; }
+ return g();
+}
+
main() {
returnInt1();
returnDyn1();
@@ -67,6 +73,7 @@
returnDyn2();
returnInt3();
returnDyn3();
+ returnInt4();
}
""";
@@ -83,12 +90,14 @@
}
checkReturn('returnInt1', compiler.intClass);
- checkReturn('returnInt2', compiler.intClass);
+ // TODO(ngeoffray): We don't use types of mutated captured
kasperl 2013/03/05 08:26:44 So you'd like to fix this to make returnInt2 retur
ngeoffray 2013/03/05 09:02:31 Depends on the TODO I added in the types inferrer:
+ // variables anymore, because they could lead to optimistic results
+ // needing to be re-analyzed.
+ checkReturn('returnInt2', compiler.dynamicClass);
checkReturn('returnInt3', compiler.intClass);
+ checkReturn('returnInt4', compiler.intClass);
checkReturn('returnDyn1', compiler.dynamicClass);
checkReturn('returnDyn2', compiler.dynamicClass);
checkReturn('returnDyn3', compiler.dynamicClass);
-
- print(typesInferrer.returnTypeOf);
}

Powered by Google App Engine
This is Rietveld 408576698