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

Unified Diff: tests/language/cyclic_type2_test.dart

Issue 109593003: Use a trail instead of a mark bit when processing recursive types in the VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « runtime/vm/raw_object_snapshot.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/cyclic_type2_test.dart
===================================================================
--- tests/language/cyclic_type2_test.dart (revision 0)
+++ tests/language/cyclic_type2_test.dart (revision 0)
@@ -0,0 +1,31 @@
+// 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.
+
+// Tests self referencing types.
+
+import "package:expect/expect.dart";
+
+class Base<U, V> {
+ get u => U;
+ get v => V;
+}
+
+class Derived1<U, V> extends Base<Derived1<U, V>,
+ Derived1<Derived2<V, U>, Derived2>> {}
+
+class Derived2<U, V> extends Base<Derived2<U, V>,
+ Derived2<Derived1<V, U>, Derived1>> {}
+
+main() {
+ var d = new Derived1<Derived1, Derived2>();
+ Expect.equals("Derived1<Derived1, Derived2>", d.u.toString());
+ Expect.equals("Derived1<Derived2<Derived2, Derived1>, Derived2>",
+ d.v.toString());
+ Expect.isTrue(d is Derived1<Derived1, Derived2>);
+ Expect.isFalse(d is Derived1<Derived1, Derived1>);
+ Expect.isTrue(d is Base<Derived1<Derived1, Derived2>,
+ Derived1<Derived2<Derived2, Derived1>, Derived2>>);
+ Expect.isFalse(d is Base<Derived1<Derived1, Derived2>,
+ Derived1<Derived2<Derived2, Derived2>, Derived2>>);
+}
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698