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 // Dart test program for constructors and initializers. |
5 | 5 |
6 // Check function subtyping for local functions on generic type against generic | 6 // Check function subtyping for local functions on generic type against generic |
7 // typedefs. | 7 // typedefs. |
8 | 8 |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 Expect.isFalse(foo is Biz<T>, 'foo is Biz<$nameOfT>'); | 26 Expect.isFalse(foo is Biz<T>, 'foo is Biz<$nameOfT>'); |
27 | 27 |
28 Expect.isFalse(baz is Foo<T>, 'baz is Foo<$nameOfT>'); | 28 Expect.isFalse(baz is Foo<T>, 'baz is Foo<$nameOfT>'); |
29 Expect.isFalse(baz is Bar<T>, 'baz is Bar<$nameOfT>'); | 29 Expect.isFalse(baz is Bar<T>, 'baz is Bar<$nameOfT>'); |
30 Expect.equals(expectedResult, baz is Baz<T>, 'baz is Baz<$nameOfT>'); | 30 Expect.equals(expectedResult, baz is Baz<T>, 'baz is Baz<$nameOfT>'); |
31 Expect.equals(expectedResult, baz is Boz<T>, 'baz is Boz<$nameOfT>'); | 31 Expect.equals(expectedResult, baz is Boz<T>, 'baz is Boz<$nameOfT>'); |
32 Expect.isFalse(baz is Biz<T>, 'bar is Biz<$nameOfT>'); | 32 Expect.isFalse(baz is Biz<T>, 'bar is Biz<$nameOfT>'); |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 class D<S,T> extends C<T> {} | 36 class D<S, T> extends C<T> {} |
37 | 37 |
38 main() { | 38 main() { |
39 new D<String, bool>().test('bool', true); | 39 new D<String, bool>().test('bool', true); |
40 new D<bool, int>().test('int', false); | 40 new D<bool, int>().test('int', false); |
41 new D().test('dynamic', true); | 41 new D().test('dynamic', true); |
42 } | 42 } |
OLD | NEW |