OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import "package:expect/expect.dart"; |
| 6 |
| 7 // Regression test for recursive inheritance patterns |
| 8 abstract class Comparable<T> { |
| 9 int compare(T a); |
| 10 } |
| 11 class MI<T extends MI<T>> { |
| 12 } |
| 13 |
| 14 class PMI<T extends Comparable<T>> extends MI<PMI<T>> {} |
| 15 |
| 16 void main() { |
| 17 var a = new MI(); |
| 18 var b = new PMI(); |
| 19 a = b; |
| 20 Expect.isTrue(a is MI); |
| 21 Expect.isTrue(b is PMI); |
| 22 Expect.isTrue(b is MI); |
| 23 Expect.isTrue(b is MI<PMI>); |
| 24 } |
OLD | NEW |