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

Unified Diff: pkg/dev_compiler/test/codegen/language/recursive_generic_test.dart

Issue 2516483002: fix #27336, ddc with recursive generic class type args (Closed)
Patch Set: Created 4 years, 1 month 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: pkg/dev_compiler/test/codegen/language/recursive_generic_test.dart
diff --git a/pkg/dev_compiler/test/codegen/language/recursive_generic_test.dart b/pkg/dev_compiler/test/codegen/language/recursive_generic_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3d8dcd642f89d8cf420ca22e290b4e36d97fbf73
--- /dev/null
+++ b/pkg/dev_compiler/test/codegen/language/recursive_generic_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2016, 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.
+
+import "package:expect/expect.dart";
+
+abstract class S<T extends S<T>> { m() => 123; get S_T => T; }
+class C<T extends C<T>> extends S<C> { m() => 456; get C_T => T; }
+
+main() {
+ Expect.equals(new C().m(), 456);
+ // TODO(jmesserly): this should be dart1 vs dart2, not DDC vs VM.
+ var isVM = const bool.fromEnvironment('dart.isVM');
+ Expect.equals(new C().S_T.toString(), isVM ? 'C' : 'C<C>');
+ Expect.equals(new C().C_T.toString(), isVM ? 'dynamic' : 'C');
+}

Powered by Google App Engine
This is Rietveld 408576698