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

Unified Diff: tests/language/closure_variable_shadow_test.dart

Issue 366853007: dart2dart: Support for inner functions in new IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: SVN rebase Created 6 years, 6 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 | « tests/compiler/dart2js/dart_printer_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/closure_variable_shadow_test.dart
diff --git a/tests/language/reify_typevar_test.dart b/tests/language/closure_variable_shadow_test.dart
similarity index 57%
copy from tests/language/reify_typevar_test.dart
copy to tests/language/closure_variable_shadow_test.dart
index 874efd681964049629144e7c794da601f50d354a..8f774b403491f7a3ff2c1cb67492ca646d269f0d 100644
--- a/tests/language/reify_typevar_test.dart
+++ b/tests/language/closure_variable_shadow_test.dart
@@ -4,13 +4,17 @@
import "package:expect/expect.dart";
-class Foo<T> {
- reify() {
- return T;
+// The intermediate variable 'y' must either be preserved
+// or parameters must be renamed.
+
+foo(x) {
+ var y = x;
+ bar(x) {
+ return y - x;
}
+ return bar;
}
main() {
- Expect.equals(int, new Foo<int>().reify());
- Expect.equals(Foo, new Foo().runtimeType);
+ Expect.equals(-10, foo(10)(20));
}
« no previous file with comments | « tests/compiler/dart2js/dart_printer_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698