OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Dart test program for constructors and initializers. |
4 | 5 |
5 // Test that a class with a [call] property does not implement [Function] or | 6 // Check function subtyping of type arguments. |
6 // a typedef of function type. | |
7 | 7 |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 | 9 |
10 class Call { | 10 class C<T> {} |
11 int get call => 0; | |
12 } | |
13 | 11 |
14 typedef void F(); | 12 class I {} |
| 13 class J extends I {} |
| 14 |
| 15 typedef void f1(C<J> c); |
| 16 typedef void f2(C<I> c); |
15 | 17 |
16 main() { | 18 main() { |
17 Expect.isFalse(new Call() is Function); | 19 Expect.isTrue(new C<f2>() is C<f1>); |
18 Expect.isFalse(new Call() is F); | |
19 } | 20 } |
OLD | NEW |