| 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 | 4 |
| 5 library subtype_test; | 5 library subtype_test; |
| 6 | 6 |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 import "package:async_helper/async_helper.dart"; | 8 import "package:async_helper/async_helper.dart"; |
| 9 import 'type_test_helper.dart'; | 9 import 'type_test_helper.dart'; |
| 10 import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart'; | 10 import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart'; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 DartType Object_ = env['Object']; | 60 DartType Object_ = env['Object']; |
| 61 DartType num_ = env['num']; | 61 DartType num_ = env['num']; |
| 62 DartType int_ = env['int']; | 62 DartType int_ = env['int']; |
| 63 DartType String_ = env['String']; | 63 DartType String_ = env['String']; |
| 64 DartType dynamic_ = env['dynamic']; | 64 DartType dynamic_ = env['dynamic']; |
| 65 | 65 |
| 66 expect(true, Object_, Object_); | 66 expect(true, Object_, Object_); |
| 67 expect(true, num_, Object_); | 67 expect(true, num_, Object_); |
| 68 expect(true, int_, Object_); | 68 expect(true, int_, Object_); |
| 69 expect(true, String_, Object_); | 69 expect(true, String_, Object_); |
| 70 expect(true, dynamic_, Object_); | 70 expect(true, dynamic_, Object_, expectMoreSpecific: false); |
| 71 | 71 |
| 72 expect(false, Object_, num_); | 72 expect(false, Object_, num_); |
| 73 expect(true, num_, num_); | 73 expect(true, num_, num_); |
| 74 expect(true, int_, num_); | 74 expect(true, int_, num_); |
| 75 expect(false, String_, num_); | 75 expect(false, String_, num_); |
| 76 expect(true, dynamic_, num_); | 76 expect(true, dynamic_, num_, expectMoreSpecific: false); |
| 77 | 77 |
| 78 expect(false, Object_, int_); | 78 expect(false, Object_, int_); |
| 79 expect(false, num_, int_); | 79 expect(false, num_, int_); |
| 80 expect(true, int_, int_); | 80 expect(true, int_, int_); |
| 81 expect(false, String_, int_); | 81 expect(false, String_, int_); |
| 82 expect(true, dynamic_, int_); | 82 expect(true, dynamic_, int_, expectMoreSpecific: false); |
| 83 | 83 |
| 84 expect(false, Object_, String_); | 84 expect(false, Object_, String_); |
| 85 expect(false, num_, String_); | 85 expect(false, num_, String_); |
| 86 expect(false, int_, String_); | 86 expect(false, int_, String_); |
| 87 expect(true, String_, String_); | 87 expect(true, String_, String_); |
| 88 expect(true, dynamic_, String_); | 88 expect(true, dynamic_, String_, expectMoreSpecific: false); |
| 89 | 89 |
| 90 expect(true, Object_, dynamic_, expectMoreSpecific: false); | 90 expect(true, Object_, dynamic_); |
| 91 expect(true, num_, dynamic_, expectMoreSpecific: false); | 91 expect(true, num_, dynamic_); |
| 92 expect(true, int_, dynamic_, expectMoreSpecific: false); | 92 expect(true, int_, dynamic_); |
| 93 expect(true, String_, dynamic_, expectMoreSpecific: false); | 93 expect(true, String_, dynamic_); |
| 94 expect(true, dynamic_, dynamic_); | 94 expect(true, dynamic_, dynamic_); |
| 95 | 95 |
| 96 DartType A_Object = instantiate(A, [Object_]); | 96 DartType A_Object = instantiate(A, [Object_]); |
| 97 DartType A_num = instantiate(A, [num_]); | 97 DartType A_num = instantiate(A, [num_]); |
| 98 DartType A_int = instantiate(A, [int_]); | 98 DartType A_int = instantiate(A, [int_]); |
| 99 DartType A_String = instantiate(A, [String_]); | 99 DartType A_String = instantiate(A, [String_]); |
| 100 DartType A_dynamic = instantiate(A, [dynamic_]); | 100 DartType A_dynamic = instantiate(A, [dynamic_]); |
| 101 | 101 |
| 102 expect(true, A_Object, Object_); | 102 expect(true, A_Object, Object_); |
| 103 expect(false, A_Object, num_); | 103 expect(false, A_Object, num_); |
| 104 expect(false, A_Object, int_); | 104 expect(false, A_Object, int_); |
| 105 expect(false, A_Object, String_); | 105 expect(false, A_Object, String_); |
| 106 expect(true, A_Object, dynamic_, expectMoreSpecific: false); | 106 expect(true, A_Object, dynamic_); |
| 107 | 107 |
| 108 expect(true, A_Object, A_Object); | 108 expect(true, A_Object, A_Object); |
| 109 expect(true, A_num, A_Object); | 109 expect(true, A_num, A_Object); |
| 110 expect(true, A_int, A_Object); | 110 expect(true, A_int, A_Object); |
| 111 expect(true, A_String, A_Object); | 111 expect(true, A_String, A_Object); |
| 112 expect(true, A_dynamic, A_Object); | 112 expect(true, A_dynamic, A_Object, expectMoreSpecific: false); |
| 113 | 113 |
| 114 expect(false, A_Object, A_num); | 114 expect(false, A_Object, A_num); |
| 115 expect(true, A_num, A_num); | 115 expect(true, A_num, A_num); |
| 116 expect(true, A_int, A_num); | 116 expect(true, A_int, A_num); |
| 117 expect(false, A_String, A_num); | 117 expect(false, A_String, A_num); |
| 118 expect(true, A_dynamic, A_num); | 118 expect(true, A_dynamic, A_num, expectMoreSpecific: false); |
| 119 | 119 |
| 120 expect(false, A_Object, A_int); | 120 expect(false, A_Object, A_int); |
| 121 expect(false, A_num, A_int); | 121 expect(false, A_num, A_int); |
| 122 expect(true, A_int, A_int); | 122 expect(true, A_int, A_int); |
| 123 expect(false, A_String, A_int); | 123 expect(false, A_String, A_int); |
| 124 expect(true, A_dynamic, A_int); | 124 expect(true, A_dynamic, A_int, expectMoreSpecific: false); |
| 125 | 125 |
| 126 expect(false, A_Object, A_String); | 126 expect(false, A_Object, A_String); |
| 127 expect(false, A_num, A_String); | 127 expect(false, A_num, A_String); |
| 128 expect(false, A_int, A_String); | 128 expect(false, A_int, A_String); |
| 129 expect(true, A_String, A_String); | 129 expect(true, A_String, A_String); |
| 130 expect(true, A_dynamic, A_String); | 130 expect(true, A_dynamic, A_String, expectMoreSpecific: false); |
| 131 | 131 |
| 132 expect(true, A_Object, A_dynamic, expectMoreSpecific: false); | 132 expect(true, A_Object, A_dynamic); |
| 133 expect(true, A_num, A_dynamic, expectMoreSpecific: false); | 133 expect(true, A_num, A_dynamic); |
| 134 expect(true, A_int, A_dynamic, expectMoreSpecific: false); | 134 expect(true, A_int, A_dynamic); |
| 135 expect(true, A_String, A_dynamic, expectMoreSpecific: false); | 135 expect(true, A_String, A_dynamic); |
| 136 expect(true, A_dynamic, A_dynamic); | 136 expect(true, A_dynamic, A_dynamic); |
| 137 | 137 |
| 138 DartType B_Object_Object = instantiate(B, [Object_, Object_]); | 138 DartType B_Object_Object = instantiate(B, [Object_, Object_]); |
| 139 DartType B_num_num = instantiate(B, [num_, num_]); | 139 DartType B_num_num = instantiate(B, [num_, num_]); |
| 140 DartType B_int_num = instantiate(B, [int_, num_]); | 140 DartType B_int_num = instantiate(B, [int_, num_]); |
| 141 DartType B_dynamic_dynamic = instantiate(B, [dynamic_, dynamic_]); | 141 DartType B_dynamic_dynamic = instantiate(B, [dynamic_, dynamic_]); |
| 142 DartType B_String_dynamic = instantiate(B, [String_, dynamic_]); | 142 DartType B_String_dynamic = instantiate(B, [String_, dynamic_]); |
| 143 | 143 |
| 144 expect(true, B_Object_Object, Object_); | 144 expect(true, B_Object_Object, Object_); |
| 145 expect(true, B_Object_Object, A_Object); | 145 expect(true, B_Object_Object, A_Object); |
| 146 expect(false, B_Object_Object, A_num); | 146 expect(false, B_Object_Object, A_num); |
| 147 expect(false, B_Object_Object, A_int); | 147 expect(false, B_Object_Object, A_int); |
| 148 expect(false, B_Object_Object, A_String); | 148 expect(false, B_Object_Object, A_String); |
| 149 expect(true, B_Object_Object, A_dynamic, expectMoreSpecific: false); | 149 expect(true, B_Object_Object, A_dynamic); |
| 150 | 150 |
| 151 expect(true, B_num_num, Object_); | 151 expect(true, B_num_num, Object_); |
| 152 expect(true, B_num_num, A_Object); | 152 expect(true, B_num_num, A_Object); |
| 153 expect(true, B_num_num, A_num); | 153 expect(true, B_num_num, A_num); |
| 154 expect(false, B_num_num, A_int); | 154 expect(false, B_num_num, A_int); |
| 155 expect(false, B_num_num, A_String); | 155 expect(false, B_num_num, A_String); |
| 156 expect(true, B_num_num, A_dynamic, expectMoreSpecific: false); | 156 expect(true, B_num_num, A_dynamic); |
| 157 | 157 |
| 158 expect(true, B_int_num, Object_); | 158 expect(true, B_int_num, Object_); |
| 159 expect(true, B_int_num, A_Object); | 159 expect(true, B_int_num, A_Object); |
| 160 expect(true, B_int_num, A_num); | 160 expect(true, B_int_num, A_num); |
| 161 expect(true, B_int_num, A_int); | 161 expect(true, B_int_num, A_int); |
| 162 expect(false, B_int_num, A_String); | 162 expect(false, B_int_num, A_String); |
| 163 expect(true, B_int_num, A_dynamic, expectMoreSpecific: false); | 163 expect(true, B_int_num, A_dynamic); |
| 164 | 164 |
| 165 expect(true, B_dynamic_dynamic, Object_); | 165 expect(true, B_dynamic_dynamic, Object_); |
| 166 expect(true, B_dynamic_dynamic, A_Object); | 166 expect(true, B_dynamic_dynamic, A_Object, expectMoreSpecific: false); |
| 167 expect(true, B_dynamic_dynamic, A_num); | 167 expect(true, B_dynamic_dynamic, A_num, expectMoreSpecific: false); |
| 168 expect(true, B_dynamic_dynamic, A_int); | 168 expect(true, B_dynamic_dynamic, A_int, expectMoreSpecific: false); |
| 169 expect(true, B_dynamic_dynamic, A_String); | 169 expect(true, B_dynamic_dynamic, A_String, expectMoreSpecific: false); |
| 170 expect(true, B_dynamic_dynamic, A_dynamic); | 170 expect(true, B_dynamic_dynamic, A_dynamic); |
| 171 | 171 |
| 172 expect(true, B_String_dynamic, Object_); | 172 expect(true, B_String_dynamic, Object_); |
| 173 expect(true, B_String_dynamic, A_Object); | 173 expect(true, B_String_dynamic, A_Object); |
| 174 expect(false, B_String_dynamic, A_num); | 174 expect(false, B_String_dynamic, A_num); |
| 175 expect(false, B_String_dynamic, A_int); | 175 expect(false, B_String_dynamic, A_int); |
| 176 expect(true, B_String_dynamic, A_String); | 176 expect(true, B_String_dynamic, A_String); |
| 177 expect(true, B_String_dynamic, A_dynamic, expectMoreSpecific: false); | 177 expect(true, B_String_dynamic, A_dynamic); |
| 178 | 178 |
| 179 expect(true, B_Object_Object, B_Object_Object); | 179 expect(true, B_Object_Object, B_Object_Object); |
| 180 expect(true, B_num_num, B_Object_Object); | 180 expect(true, B_num_num, B_Object_Object); |
| 181 expect(true, B_int_num, B_Object_Object); | 181 expect(true, B_int_num, B_Object_Object); |
| 182 expect(true, B_dynamic_dynamic, B_Object_Object); | 182 expect(true, B_dynamic_dynamic, B_Object_Object, expectMoreSpecific: false); |
| 183 expect(true, B_String_dynamic, B_Object_Object); | 183 expect(true, B_String_dynamic, B_Object_Object, expectMoreSpecific: false); |
| 184 | 184 |
| 185 expect(false, B_Object_Object, B_num_num); | 185 expect(false, B_Object_Object, B_num_num); |
| 186 expect(true, B_num_num, B_num_num); | 186 expect(true, B_num_num, B_num_num); |
| 187 expect(true, B_int_num, B_num_num); | 187 expect(true, B_int_num, B_num_num); |
| 188 expect(true, B_dynamic_dynamic, B_num_num); | 188 expect(true, B_dynamic_dynamic, B_num_num, expectMoreSpecific: false); |
| 189 expect(false, B_String_dynamic, B_num_num); | 189 expect(false, B_String_dynamic, B_num_num); |
| 190 | 190 |
| 191 expect(false, B_Object_Object, B_int_num); | 191 expect(false, B_Object_Object, B_int_num); |
| 192 expect(false, B_num_num, B_int_num); | 192 expect(false, B_num_num, B_int_num); |
| 193 expect(true, B_int_num, B_int_num); | 193 expect(true, B_int_num, B_int_num); |
| 194 expect(true, B_dynamic_dynamic, B_int_num); | 194 expect(true, B_dynamic_dynamic, B_int_num, expectMoreSpecific: false); |
| 195 expect(false, B_String_dynamic, B_int_num); | 195 expect(false, B_String_dynamic, B_int_num); |
| 196 | 196 |
| 197 expect(true, B_Object_Object, B_dynamic_dynamic, expectMoreSpecific: false); | 197 expect(true, B_Object_Object, B_dynamic_dynamic); |
| 198 expect(true, B_num_num, B_dynamic_dynamic, expectMoreSpecific: false); | 198 expect(true, B_num_num, B_dynamic_dynamic); |
| 199 expect(true, B_int_num, B_dynamic_dynamic, expectMoreSpecific: false); | 199 expect(true, B_int_num, B_dynamic_dynamic); |
| 200 expect(true, B_dynamic_dynamic, B_dynamic_dynamic); | 200 expect(true, B_dynamic_dynamic, B_dynamic_dynamic); |
| 201 expect(true, B_String_dynamic, B_dynamic_dynamic, | 201 expect(true, B_String_dynamic, B_dynamic_dynamic); |
| 202 expectMoreSpecific: false); | |
| 203 | 202 |
| 204 expect(false, B_Object_Object, B_String_dynamic); | 203 expect(false, B_Object_Object, B_String_dynamic); |
| 205 expect(false, B_num_num, B_String_dynamic); | 204 expect(false, B_num_num, B_String_dynamic); |
| 206 expect(false, B_int_num, B_String_dynamic); | 205 expect(false, B_int_num, B_String_dynamic); |
| 207 expect(true, B_dynamic_dynamic, B_String_dynamic); | 206 expect(true, B_dynamic_dynamic, B_String_dynamic, |
| 207 expectMoreSpecific: false); |
| 208 expect(true, B_String_dynamic, B_String_dynamic); | 208 expect(true, B_String_dynamic, B_String_dynamic); |
| 209 | 209 |
| 210 DartType C_Object_Object = instantiate(C, [Object_, Object_]); | 210 DartType C_Object_Object = instantiate(C, [Object_, Object_]); |
| 211 DartType C_num_num = instantiate(C, [num_, num_]); | 211 DartType C_num_num = instantiate(C, [num_, num_]); |
| 212 DartType C_int_String = instantiate(C, [int_, String_]); | 212 DartType C_int_String = instantiate(C, [int_, String_]); |
| 213 DartType C_dynamic_dynamic = instantiate(C, [dynamic_, dynamic_]); | 213 DartType C_dynamic_dynamic = instantiate(C, [dynamic_, dynamic_]); |
| 214 | 214 |
| 215 expect(true, C_Object_Object, B_Object_Object); | 215 expect(true, C_Object_Object, B_Object_Object); |
| 216 expect(false, C_Object_Object, B_num_num); | 216 expect(false, C_Object_Object, B_num_num); |
| 217 expect(false, C_Object_Object, B_int_num); | 217 expect(false, C_Object_Object, B_int_num); |
| 218 expect(true, C_Object_Object, B_dynamic_dynamic, expectMoreSpecific: false); | 218 expect(true, C_Object_Object, B_dynamic_dynamic); |
| 219 expect(false, C_Object_Object, B_String_dynamic); | 219 expect(false, C_Object_Object, B_String_dynamic); |
| 220 | 220 |
| 221 expect(true, C_num_num, B_Object_Object); | 221 expect(true, C_num_num, B_Object_Object); |
| 222 expect(true, C_num_num, B_num_num); | 222 expect(true, C_num_num, B_num_num); |
| 223 expect(false, C_num_num, B_int_num); | 223 expect(false, C_num_num, B_int_num); |
| 224 expect(true, C_num_num, B_dynamic_dynamic, expectMoreSpecific: false); | 224 expect(true, C_num_num, B_dynamic_dynamic); |
| 225 expect(false, C_num_num, B_String_dynamic); | 225 expect(false, C_num_num, B_String_dynamic); |
| 226 | 226 |
| 227 expect(true, C_int_String, B_Object_Object); | 227 expect(true, C_int_String, B_Object_Object); |
| 228 expect(false, C_int_String, B_num_num); | 228 expect(false, C_int_String, B_num_num); |
| 229 expect(false, C_int_String, B_int_num); | 229 expect(false, C_int_String, B_int_num); |
| 230 expect(true, C_int_String, B_dynamic_dynamic, expectMoreSpecific: false); | 230 expect(true, C_int_String, B_dynamic_dynamic); |
| 231 expect(true, C_int_String, B_String_dynamic, expectMoreSpecific: false); | 231 expect(true, C_int_String, B_String_dynamic); |
| 232 | 232 |
| 233 expect(true, C_dynamic_dynamic, B_Object_Object); | 233 expect(true, C_dynamic_dynamic, B_Object_Object, expectMoreSpecific: false); |
| 234 expect(true, C_dynamic_dynamic, B_num_num); | 234 expect(true, C_dynamic_dynamic, B_num_num, expectMoreSpecific: false); |
| 235 expect(true, C_dynamic_dynamic, B_int_num); | 235 expect(true, C_dynamic_dynamic, B_int_num, expectMoreSpecific: false); |
| 236 expect(true, C_dynamic_dynamic, B_dynamic_dynamic); | 236 expect(true, C_dynamic_dynamic, B_dynamic_dynamic); |
| 237 expect(true, C_dynamic_dynamic, B_String_dynamic); | 237 expect(true, C_dynamic_dynamic, B_String_dynamic, |
| 238 expectMoreSpecific: false); |
| 238 | 239 |
| 239 expect(false, C_int_String, A_int); | 240 expect(false, C_int_String, A_int); |
| 240 expect(true, C_int_String, A_String); | 241 expect(true, C_int_String, A_String); |
| 241 // TODO(johnniwinther): Inheritance with different type arguments is | 242 // TODO(johnniwinther): Inheritance with different type arguments is |
| 242 // currently not supported by the implementation. | 243 // currently not supported by the implementation. |
| 243 //expect(true, C_int_String, instantiate(A, [A_int])); | 244 //expect(true, C_int_String, instantiate(A, [A_int])); |
| 244 expect(false, C_int_String, instantiate(A, [A_String])); | 245 expect(false, C_int_String, instantiate(A, [A_String])); |
| 245 })); | 246 })); |
| 246 } | 247 } |
| 247 | 248 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 DartType num_ = env['num']; | 580 DartType num_ = env['num']; |
| 580 DartType int_ = env['int']; | 581 DartType int_ = env['int']; |
| 581 DartType String_ = env['String']; | 582 DartType String_ = env['String']; |
| 582 DartType dynamic_ = env['dynamic']; | 583 DartType dynamic_ = env['dynamic']; |
| 583 | 584 |
| 584 // class A<T> {} | 585 // class A<T> {} |
| 585 expect(true, A_T, Object_); | 586 expect(true, A_T, Object_); |
| 586 expect(false, A_T, num_); | 587 expect(false, A_T, num_); |
| 587 expect(false, A_T, int_); | 588 expect(false, A_T, int_); |
| 588 expect(false, A_T, String_); | 589 expect(false, A_T, String_); |
| 589 expect(true, A_T, dynamic_, expectMoreSpecific: false); | 590 expect(true, A_T, dynamic_); |
| 590 expect(true, A_T, A_T); | 591 expect(true, A_T, A_T); |
| 591 expect(false, A_T, B_T); | 592 expect(false, A_T, B_T); |
| 592 | 593 |
| 593 // class B<T extends Object> {} | 594 // class B<T extends Object> {} |
| 594 expect(true, B_T, Object_); | 595 expect(true, B_T, Object_); |
| 595 expect(false, B_T, num_); | 596 expect(false, B_T, num_); |
| 596 expect(false, B_T, int_); | 597 expect(false, B_T, int_); |
| 597 expect(false, B_T, String_); | 598 expect(false, B_T, String_); |
| 598 expect(true, B_T, dynamic_, expectMoreSpecific: false); | 599 expect(true, B_T, dynamic_); |
| 599 expect(true, B_T, B_T); | 600 expect(true, B_T, B_T); |
| 600 expect(false, B_T, A_T); | 601 expect(false, B_T, A_T); |
| 601 | 602 |
| 602 // class C<T extends num> {} | 603 // class C<T extends num> {} |
| 603 expect(true, C_T, Object_); | 604 expect(true, C_T, Object_); |
| 604 expect(true, C_T, num_); | 605 expect(true, C_T, num_); |
| 605 expect(false, C_T, int_); | 606 expect(false, C_T, int_); |
| 606 expect(false, C_T, String_); | 607 expect(false, C_T, String_); |
| 607 expect(true, C_T, dynamic_, expectMoreSpecific: false); | 608 expect(true, C_T, dynamic_); |
| 608 expect(true, C_T, C_T); | 609 expect(true, C_T, C_T); |
| 609 expect(false, C_T, A_T); | 610 expect(false, C_T, A_T); |
| 610 | 611 |
| 611 // class D<T extends int> {} | 612 // class D<T extends int> {} |
| 612 expect(true, D_T, Object_); | 613 expect(true, D_T, Object_); |
| 613 expect(true, D_T, num_); | 614 expect(true, D_T, num_); |
| 614 expect(true, D_T, int_); | 615 expect(true, D_T, int_); |
| 615 expect(false, D_T, String_); | 616 expect(false, D_T, String_); |
| 616 expect(true, D_T, dynamic_, expectMoreSpecific: false); | 617 expect(true, D_T, dynamic_); |
| 617 expect(true, D_T, D_T); | 618 expect(true, D_T, D_T); |
| 618 expect(false, D_T, A_T); | 619 expect(false, D_T, A_T); |
| 619 | 620 |
| 620 // class E<T extends S, S extends num> {} | 621 // class E<T extends S, S extends num> {} |
| 621 expect(true, E_T, Object_); | 622 expect(true, E_T, Object_); |
| 622 expect(true, E_T, num_); | 623 expect(true, E_T, num_); |
| 623 expect(false, E_T, int_); | 624 expect(false, E_T, int_); |
| 624 expect(false, E_T, String_); | 625 expect(false, E_T, String_); |
| 625 expect(true, E_T, dynamic_, expectMoreSpecific: false); | 626 expect(true, E_T, dynamic_); |
| 626 expect(true, E_T, E_T); | 627 expect(true, E_T, E_T); |
| 627 expect(true, E_T, E_S); | 628 expect(true, E_T, E_S); |
| 628 expect(false, E_T, A_T); | 629 expect(false, E_T, A_T); |
| 629 | 630 |
| 630 expect(true, E_S, Object_); | 631 expect(true, E_S, Object_); |
| 631 expect(true, E_S, num_); | 632 expect(true, E_S, num_); |
| 632 expect(false, E_S, int_); | 633 expect(false, E_S, int_); |
| 633 expect(false, E_S, String_); | 634 expect(false, E_S, String_); |
| 634 expect(true, E_S, dynamic_, expectMoreSpecific: false); | 635 expect(true, E_S, dynamic_); |
| 635 expect(false, E_S, E_T); | 636 expect(false, E_S, E_T); |
| 636 expect(true, E_S, E_S); | 637 expect(true, E_S, E_S); |
| 637 expect(false, E_S, A_T); | 638 expect(false, E_S, A_T); |
| 638 | 639 |
| 639 // class F<T extends num, S extends T> {} | 640 // class F<T extends num, S extends T> {} |
| 640 expect(true, F_T, Object_); | 641 expect(true, F_T, Object_); |
| 641 expect(true, F_T, num_); | 642 expect(true, F_T, num_); |
| 642 expect(false, F_T, int_); | 643 expect(false, F_T, int_); |
| 643 expect(false, F_T, String_); | 644 expect(false, F_T, String_); |
| 644 expect(true, F_T, dynamic_, expectMoreSpecific: false); | 645 expect(true, F_T, dynamic_); |
| 645 expect(false, F_T, F_S); | 646 expect(false, F_T, F_S); |
| 646 expect(true, F_T, F_T); | 647 expect(true, F_T, F_T); |
| 647 expect(false, F_T, A_T); | 648 expect(false, F_T, A_T); |
| 648 | 649 |
| 649 expect(true, F_S, Object_); | 650 expect(true, F_S, Object_); |
| 650 expect(true, F_S, num_); | 651 expect(true, F_S, num_); |
| 651 expect(false, F_S, int_); | 652 expect(false, F_S, int_); |
| 652 expect(false, F_S, String_); | 653 expect(false, F_S, String_); |
| 653 expect(true, F_S, dynamic_, expectMoreSpecific: false); | 654 expect(true, F_S, dynamic_); |
| 654 expect(true, F_S, F_S); | 655 expect(true, F_S, F_S); |
| 655 expect(true, F_S, F_T); | 656 expect(true, F_S, F_T); |
| 656 expect(false, F_S, A_T); | 657 expect(false, F_S, A_T); |
| 657 | 658 |
| 658 // class G<T extends T> {} | 659 // class G<T extends T> {} |
| 659 expect(true, G_T, Object_); | 660 expect(true, G_T, Object_); |
| 660 expect(false, G_T, num_); | 661 expect(false, G_T, num_); |
| 661 expect(false, G_T, int_); | 662 expect(false, G_T, int_); |
| 662 expect(false, G_T, String_); | 663 expect(false, G_T, String_); |
| 663 expect(true, G_T, dynamic_, expectMoreSpecific: false); | 664 expect(true, G_T, dynamic_); |
| 664 expect(true, G_T, G_T); | 665 expect(true, G_T, G_T); |
| 665 expect(false, G_T, A_T); | 666 expect(false, G_T, A_T); |
| 666 | 667 |
| 667 // class H<T extends S, S extends T> {} | 668 // class H<T extends S, S extends T> {} |
| 668 expect(true, H_T, Object_); | 669 expect(true, H_T, Object_); |
| 669 expect(false, H_T, num_); | 670 expect(false, H_T, num_); |
| 670 expect(false, H_T, int_); | 671 expect(false, H_T, int_); |
| 671 expect(false, H_T, String_); | 672 expect(false, H_T, String_); |
| 672 expect(true, H_T, dynamic_, expectMoreSpecific: false); | 673 expect(true, H_T, dynamic_); |
| 673 expect(true, H_T, H_T); | 674 expect(true, H_T, H_T); |
| 674 expect(true, H_T, H_S); | 675 expect(true, H_T, H_S); |
| 675 expect(false, H_T, A_T); | 676 expect(false, H_T, A_T); |
| 676 | 677 |
| 677 expect(true, H_S, Object_); | 678 expect(true, H_S, Object_); |
| 678 expect(false, H_S, num_); | 679 expect(false, H_S, num_); |
| 679 expect(false, H_S, int_); | 680 expect(false, H_S, int_); |
| 680 expect(false, H_S, String_); | 681 expect(false, H_S, String_); |
| 681 expect(true, H_S, dynamic_, expectMoreSpecific: false); | 682 expect(true, H_S, dynamic_); |
| 682 expect(true, H_S, H_T); | 683 expect(true, H_S, H_T); |
| 683 expect(true, H_S, H_S); | 684 expect(true, H_S, H_S); |
| 684 expect(false, H_S, A_T); | 685 expect(false, H_S, A_T); |
| 685 | 686 |
| 686 // class I<T extends S, S extends U, U extends T> {} | 687 // class I<T extends S, S extends U, U extends T> {} |
| 687 expect(true, I_T, Object_); | 688 expect(true, I_T, Object_); |
| 688 expect(false, I_T, num_); | 689 expect(false, I_T, num_); |
| 689 expect(false, I_T, int_); | 690 expect(false, I_T, int_); |
| 690 expect(false, I_T, String_); | 691 expect(false, I_T, String_); |
| 691 expect(true, I_T, dynamic_, expectMoreSpecific: false); | 692 expect(true, I_T, dynamic_); |
| 692 expect(true, I_T, I_T); | 693 expect(true, I_T, I_T); |
| 693 expect(true, I_T, I_S); | 694 expect(true, I_T, I_S); |
| 694 expect(true, I_T, I_U); | 695 expect(true, I_T, I_U); |
| 695 expect(false, I_T, A_T); | 696 expect(false, I_T, A_T); |
| 696 | 697 |
| 697 expect(true, I_S, Object_); | 698 expect(true, I_S, Object_); |
| 698 expect(false, I_S, num_); | 699 expect(false, I_S, num_); |
| 699 expect(false, I_S, int_); | 700 expect(false, I_S, int_); |
| 700 expect(false, I_S, String_); | 701 expect(false, I_S, String_); |
| 701 expect(true, I_S, dynamic_, expectMoreSpecific: false); | 702 expect(true, I_S, dynamic_); |
| 702 expect(true, I_S, I_T); | 703 expect(true, I_S, I_T); |
| 703 expect(true, I_S, I_S); | 704 expect(true, I_S, I_S); |
| 704 expect(true, I_S, I_U); | 705 expect(true, I_S, I_U); |
| 705 expect(false, I_S, A_T); | 706 expect(false, I_S, A_T); |
| 706 | 707 |
| 707 expect(true, I_U, Object_); | 708 expect(true, I_U, Object_); |
| 708 expect(false, I_U, num_); | 709 expect(false, I_U, num_); |
| 709 expect(false, I_U, int_); | 710 expect(false, I_U, int_); |
| 710 expect(false, I_U, String_); | 711 expect(false, I_U, String_); |
| 711 expect(true, I_U, dynamic_, expectMoreSpecific: false); | 712 expect(true, I_U, dynamic_); |
| 712 expect(true, I_U, I_T); | 713 expect(true, I_U, I_T); |
| 713 expect(true, I_U, I_S); | 714 expect(true, I_U, I_S); |
| 714 expect(true, I_U, I_U); | 715 expect(true, I_U, I_U); |
| 715 expect(false, I_U, A_T); | 716 expect(false, I_U, A_T); |
| 716 | 717 |
| 717 // class J<T extends S, S extends U, U extends S> {} | 718 // class J<T extends S, S extends U, U extends S> {} |
| 718 expect(true, J_T, Object_); | 719 expect(true, J_T, Object_); |
| 719 expect(false, J_T, num_); | 720 expect(false, J_T, num_); |
| 720 expect(false, J_T, int_); | 721 expect(false, J_T, int_); |
| 721 expect(false, J_T, String_); | 722 expect(false, J_T, String_); |
| 722 expect(true, J_T, dynamic_, expectMoreSpecific: false); | 723 expect(true, J_T, dynamic_); |
| 723 expect(true, J_T, J_T); | 724 expect(true, J_T, J_T); |
| 724 expect(true, J_T, J_S); | 725 expect(true, J_T, J_S); |
| 725 expect(true, J_T, J_U); | 726 expect(true, J_T, J_U); |
| 726 expect(false, J_T, A_T); | 727 expect(false, J_T, A_T); |
| 727 | 728 |
| 728 expect(true, J_S, Object_); | 729 expect(true, J_S, Object_); |
| 729 expect(false, J_S, num_); | 730 expect(false, J_S, num_); |
| 730 expect(false, J_S, int_); | 731 expect(false, J_S, int_); |
| 731 expect(false, J_S, String_); | 732 expect(false, J_S, String_); |
| 732 expect(true, J_S, dynamic_, expectMoreSpecific: false); | 733 expect(true, J_S, dynamic_); |
| 733 expect(false, J_S, J_T); | 734 expect(false, J_S, J_T); |
| 734 expect(true, J_S, J_S); | 735 expect(true, J_S, J_S); |
| 735 expect(true, J_S, J_U); | 736 expect(true, J_S, J_U); |
| 736 expect(false, J_S, A_T); | 737 expect(false, J_S, A_T); |
| 737 | 738 |
| 738 expect(true, J_U, Object_); | 739 expect(true, J_U, Object_); |
| 739 expect(false, J_U, num_); | 740 expect(false, J_U, num_); |
| 740 expect(false, J_U, int_); | 741 expect(false, J_U, int_); |
| 741 expect(false, J_U, String_); | 742 expect(false, J_U, String_); |
| 742 expect(true, J_U, dynamic_, expectMoreSpecific: false); | 743 expect(true, J_U, dynamic_); |
| 743 expect(false, J_U, J_T); | 744 expect(false, J_U, J_T); |
| 744 expect(true, J_U, J_S); | 745 expect(true, J_U, J_S); |
| 745 expect(true, J_U, J_U); | 746 expect(true, J_U, J_U); |
| 746 expect(false, J_U, A_T); | 747 expect(false, J_U, A_T); |
| 747 })); | 748 })); |
| 748 } | 749 } |
| OLD | NEW |