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

Unified Diff: tests/language/function_literals2_test.dart

Issue 232213003: Allow function literals in string interpolation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 | « runtime/vm/parser.cc ('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/function_literals2_test.dart
===================================================================
--- tests/language/function_literals2_test.dart (revision 34886)
+++ tests/language/function_literals2_test.dart (working copy)
@@ -46,6 +46,9 @@
Expect.equals(10, b.n);
Expect.equals(101, (b.f)(10));
+ var c = new C(5);
+ Expect.equals("2*x is 10", c.s);
+
int x = 0;
int y = 1;
// make sure this isn't parsed as a generic type
@@ -73,6 +76,10 @@
B.withZ(z) : f = ((x) { return x * x + 1; }) { n = z; }
}
+class C {
+ String s;
+ C(x) : s = "2*x is ${() { return 2*x; }()}";
+}
main() {
FunctionLiteralsTest.testMain();
}
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698