OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 abstract class S<T extends S<T>> { m() => 123; get S_T => T; } | 7 abstract class S<T extends S<T>> { |
8 class C<T extends C<T>> extends S<C> { m() => 456; get C_T => T; } | 8 m() => 123; |
| 9 get S_T => T; |
| 10 } |
| 11 |
| 12 class C<T extends C<T>> extends S<C> { |
| 13 m() => 456; |
| 14 get C_T => T; |
| 15 } |
9 | 16 |
10 class D extends C<D> {} | 17 class D extends C<D> {} |
11 | 18 |
12 main() { | 19 main() { |
13 Expect.equals(new C<D>().m(), 456); | 20 Expect.equals(new C<D>().m(), 456); |
14 // TODO(jmesserly): this should be dart1 vs dart2, not DDC vs VM. | 21 // TODO(jmesserly): this should be dart1 vs dart2, not DDC vs VM. |
15 var isVM = const bool.fromEnvironment('dart.isVM'); | 22 var isVM = const bool.fromEnvironment('dart.isVM'); |
16 Expect.equals(new C<D>().S_T.toString(), isVM ? 'C' : 'C<C>'); | 23 Expect.equals(new C<D>().S_T.toString(), isVM ? 'C' : 'C<C>'); |
17 Expect.equals(new C<D>().C_T.toString(), isVM ? 'dynamic' : 'D'); | 24 Expect.equals(new C<D>().C_T.toString(), isVM ? 'dynamic' : 'D'); |
18 } | 25 } |
OLD | NEW |