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 // Test that Null is a subtype of any other type. | 5 // Test that Null is a subtype of any other type. |
6 | 6 |
7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
8 | 8 |
9 class A {} | 9 class A {} |
10 typedef A ReturnA(); | 10 typedef A ReturnA(); |
(...skipping 18 matching lines...) Expand all Loading... |
29 main() { | 29 main() { |
30 if (false) test(); // Perform static checks only. | 30 if (false) test(); // Perform static checks only. |
31 } | 31 } |
32 | 32 |
33 test() { | 33 test() { |
34 Null n; | 34 Null n; |
35 List<Null> listNull; | 35 List<Null> listNull; |
36 A a = new A(); | 36 A a = new A(); |
37 List<A> listA; | 37 List<A> listA; |
38 | 38 |
39 testA(n); // /// 01: o
k | 39 testA(n); // //# 01: o
k |
40 testA(a); // /// 02: o
k | 40 testA(a); // //# 02: o
k |
41 testListA(listNull); // /// 03: o
k | 41 testListA(listNull); // //# 03: o
k |
42 testListA(listA); // /// 04: o
k | 42 testListA(listA); // //# 04: o
k |
43 | 43 |
44 testNull(n); // /// 05: o
k | 44 testNull(n); // //# 05: o
k |
45 testNull(a); // /// 06: o
k | 45 testNull(a); // //# 06: o
k |
46 testListNull(listNull); // /// 07: o
k | 46 testListNull(listNull); // //# 07: o
k |
47 testListNull(listA); // /// 08: o
k | 47 testListNull(listA); // //# 08: o
k |
48 | 48 |
49 testReturnA(returnA); // /// 09: o
k | 49 testReturnA(returnA); // //# 09: o
k |
50 testReturnA(returnNull); // /// 10: o
k | 50 testReturnA(returnNull); // //# 10: o
k |
51 | 51 |
52 testReturnNull(returnA); // /// 11: o
k | 52 testReturnNull(returnA); // //# 11: o
k |
53 testReturnNull(returnNull); // /// 12: o
k | 53 testReturnNull(returnNull); // //# 12: o
k |
54 | 54 |
55 testTakeA(takeA); // /// 13: o
k | 55 testTakeA(takeA); // //# 13: o
k |
56 testTakeA(takeNull); // /// 14: o
k | 56 testTakeA(takeNull); // //# 14: o
k |
57 | 57 |
58 testTakeNull(takeA); // /// 15: o
k | 58 testTakeNull(takeA); // //# 15: o
k |
59 testTakeNull(takeNull); // /// 16: o
k | 59 testTakeNull(takeNull); // //# 16: o
k |
60 } | 60 } |
OLD | NEW |