OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // Test that closurizing a function implies a dependency on its type. | 5 // Test that closurizing a function implies a dependency on its type. |
6 | 6 |
7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 | 8 |
9 import 'deferred_regression_22995_lib.dart' deferred as lib; | 9 import 'deferred_regression_22995_lib.dart' deferred as lib; |
10 | 10 |
11 class A {} | 11 class A {} |
| 12 |
12 class B {} | 13 class B {} |
| 14 |
13 class C {} | 15 class C {} |
14 | 16 |
15 typedef Ti(int x); | 17 typedef Ti(int x); |
16 typedef TB(B x); | 18 typedef TB(B x); |
17 typedef TTi(Ti x); | 19 typedef TTi(Ti x); |
18 typedef Tg<T>(T x); | 20 typedef Tg<T>(T x); |
19 | 21 |
20 class T { | 22 class T { |
21 fA(A a) => null; | 23 fA(A a) => null; |
22 fTB(TB a) => null; | 24 fTB(TB a) => null; |
23 fTgC(Tg<C> a) => null; | 25 fTgC(Tg<C> a) => null; |
24 } | 26 } |
25 | 27 |
26 main() { | 28 main() { |
27 Expect.isFalse(new T().fA is Ti); | 29 Expect.isFalse(new T().fA is Ti); |
28 Expect.isFalse(new T().fTB is TTi); | 30 Expect.isFalse(new T().fTB is TTi); |
29 Expect.isFalse(new T().fTgC is TTi); | 31 Expect.isFalse(new T().fTgC is TTi); |
30 lib.loadLibrary().then((_) { | 32 lib.loadLibrary().then((_) { |
31 lib.foofoo(); | 33 lib.foofoo(); |
32 }); | 34 }); |
33 } | 35 } |
34 | |
OLD | NEW |