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

Unified Diff: tests/language/type_variable_initializer_test.dart

Issue 12079116: Fix a crash in dart2js where references to this in inlined initializers id not know what instructio… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/ssa/builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_variable_initializer_test.dart
===================================================================
--- tests/language/type_variable_initializer_test.dart (revision 0)
+++ tests/language/type_variable_initializer_test.dart (revision 0)
@@ -0,0 +1,23 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for dart2js where the reference to [:this:] in a
+// constructor was not propagated to the super initializers.
+
+class A<T> {
+ var map;
+ // Usage of type variables in the intializer makes the SSA builder
+ // want to access [:this:]. And because the initializers of A are
+ // inlined in the constructor of B, we have to make sure the
+ // [:this:] in the A constructor has a corresponding
+ // SSA instruction.
+ A() : map = new Map<T, T>();
+}
+
+class B<T> extends A<T> {
+}
+
+main() {
+ Expect.isTrue(new B<int>().map is Map<int, int>);
+}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698