OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import "compiler_helper.dart"; | 6 import "compiler_helper.dart"; |
7 import "parser_helper.dart"; | 7 import "parser_helper.dart"; |
8 import "../../../sdk/lib/_internal/compiler/implementation/ssa/ssa.dart"; | 8 import "../../../sdk/lib/_internal/compiler/implementation/ssa/ssa.dart"; |
9 import "../../../sdk/lib/_internal/compiler/implementation/types/types.dart"; | 9 import "../../../sdk/lib/_internal/compiler/implementation/types/types.dart"; |
10 | 10 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 rule(jsStringOrNull, jsStringOrNull, jsStringOrNull); | 368 rule(jsStringOrNull, jsStringOrNull, jsStringOrNull); |
369 rule(jsStringOrNull, nullType, jsStringOrNull); | 369 rule(jsStringOrNull, nullType, jsStringOrNull); |
370 rule(jsStringOrNull, jsFixedArray, jsIndexableOrNull); | 370 rule(jsStringOrNull, jsFixedArray, jsIndexableOrNull); |
371 | 371 |
372 rule(nullType, nullType, nullType); | 372 rule(nullType, nullType, nullType); |
373 rule(nullType, jsFixedArray, jsFixedArrayOrNull); | 373 rule(nullType, jsFixedArray, jsFixedArrayOrNull); |
374 | 374 |
375 rule(jsFixedArray, jsFixedArray, jsFixedArray); | 375 rule(jsFixedArray, jsFixedArray, jsFixedArray); |
376 | 376 |
377 check(nonPrimitive1, nullType, (type) => type is HBoundedType); | 377 check(nonPrimitive1, nullType, (type) => type == nonPrimitive1.nullable()); |
378 check(nonPrimitive2, nullType, (type) => type is HBoundedType); | 378 check(nonPrimitive2, nullType, (type) => type == nonPrimitive2.nullable()); |
379 check(nullType, nonPrimitive1, (type) => type.isNullable); | 379 check(nullType, nonPrimitive1, (type) => type == nonPrimitive1.nullable()); |
380 check(nullType, nonPrimitive2, (type) => type.isNullable); | 380 check(nullType, nonPrimitive2, (type) => type == nonPrimitive2.nullable()); |
381 | 381 |
382 ruleSet.validateCoverage(); | 382 ruleSet.validateCoverage(); |
383 } | 383 } |
384 | 384 |
385 void testIntersection(MockCompiler compiler) { | 385 void testIntersection(MockCompiler compiler) { |
386 RuleSet ruleSet = new RuleSet('intersection', | 386 RuleSet ruleSet = new RuleSet('intersection', |
387 (t1, t2) => t1.intersection(t2, compiler)); | 387 (t1, t2) => t1.intersection(t2, compiler)); |
388 rule(type1, type2, result) => ruleSet.rule(type1, type2, result); | 388 rule(type1, type2, result) => ruleSet.rule(type1, type2, result); |
389 | 389 |
390 rule(emptyType, emptyType, emptyType); | 390 rule(emptyType, emptyType, emptyType); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 objectType = new TypeMask.nonNullSubclass( | 746 objectType = new TypeMask.nonNullSubclass( |
747 compiler.objectClass); | 747 compiler.objectClass); |
748 emptyType = const TypeMask.nonNullEmpty(); | 748 emptyType = const TypeMask.nonNullEmpty(); |
749 dynamicType = new TypeMask.subclass( | 749 dynamicType = new TypeMask.subclass( |
750 compiler.objectClass); | 750 compiler.objectClass); |
751 | 751 |
752 testUnion(compiler); | 752 testUnion(compiler); |
753 testIntersection(compiler); | 753 testIntersection(compiler); |
754 testRegressions(compiler); | 754 testRegressions(compiler); |
755 } | 755 } |
OLD | NEW |