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

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

Issue 1011403003: cps-ir: Set runtime type information for new objects that require it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/js_backend_cps_ir_constructor_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart
index 1e5f4bf9ff53a8df521f739e08193f8d3168c5d9..cada49cbe9615f3cc898ec97aacb7c3d27644f21 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart
@@ -164,7 +164,46 @@ function() {
v0.Bar$5$q$w$y$z("x", null, "w", "y", "z");
return v0;
}"""),
-];
+ const TestEntry(r"""
+class C<T> {
+ foo() => T;
+}
+main() {
+ print(new C<int>().foo());
+}""", r"""
+function() {
+ var v0;
+ v0 = P.$int;
+ P.print(H.setRuntimeTypeInfo(V.C$(), [v0]).foo$0());
+ return null;
+}"""),
+ const TestEntry(r"""
+class C<T> {
+ foo() => C;
+}
+main() {
+ print(new C<int>().foo());
+}""", r"""
+function() {
+ P.print(V.C$().foo$0());
+ return null;
+}"""),
+ const TestEntry.forMethod('function(C#foo)', r"""
+class C<T> {
+ foo() => new D<C<T>>();
+}
+class D<T> {
+ bar() => T;
+}
+main() {
+ print(new C<int>().foo().bar());
+}""", r"""
+function() {
+ var v0;
+ v0 = [V.C, H.getTypeArgumentByIndex(this, 0)];
+ return H.setRuntimeTypeInfo(V.D$(), [v0]);
+}"""),
+ ];
void main() {
runTests(tests);

Powered by Google App Engine
This is Rietveld 408576698