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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import "package:async_helper/async_helper.dart"; | 6 import "package:async_helper/async_helper.dart"; |
7 import 'package:compiler/src/types/types.dart' show TypeMask; | 7 import 'package:compiler/src/types/types.dart' show TypeMask; |
8 import 'type_mask_test_helper.dart'; | 8 import 'type_mask_test_helper.dart'; |
9 | 9 |
10 import 'compiler_helper.dart'; | 10 import 'compiler_helper.dart'; |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 checkReturn('returnInt5', typesTask.uint32Type); // uint31+uint31->uint32 | 750 checkReturn('returnInt5', typesTask.uint32Type); // uint31+uint31->uint32 |
751 checkReturn('returnInt6', typesTask.uint32Type); // uint31+uint31->uint32 | 751 checkReturn('returnInt6', typesTask.uint32Type); // uint31+uint31->uint32 |
752 checkReturn('returnIntOrNull', typesTask.uint31Type.nullable()); | 752 checkReturn('returnIntOrNull', typesTask.uint31Type.nullable()); |
753 checkReturn('returnInt3', typesTask.uint31Type); | 753 checkReturn('returnInt3', typesTask.uint31Type); |
754 checkReturn('returnDynamic', typesTask.dynamicType); | 754 checkReturn('returnDynamic', typesTask.dynamicType); |
755 checkReturn('returnInt4', typesTask.uint31Type); | 755 checkReturn('returnInt4', typesTask.uint31Type); |
756 checkReturn('returnInt7', typesTask.positiveIntType); | 756 checkReturn('returnInt7', typesTask.positiveIntType); |
757 checkReturn('returnInt8', typesTask.positiveIntType); | 757 checkReturn('returnInt8', typesTask.positiveIntType); |
758 checkReturn('returnEmpty1', const TypeMask.nonNullEmpty()); | 758 checkReturn('returnEmpty1', const TypeMask.nonNullEmpty()); |
759 checkReturn('returnEmpty2', const TypeMask.nonNullEmpty()); | 759 checkReturn('returnEmpty2', const TypeMask.nonNullEmpty()); |
760 TypeMask intType = new TypeMask.nonNullSubtype(compiler.intClass, | 760 TypeMask intType = new TypeMask.nonNullSubtype( |
761 compiler.world); | 761 compiler.coreClasses.intClass, compiler.world); |
762 checkReturn('testIsCheck1', intType); | 762 checkReturn('testIsCheck1', intType); |
763 checkReturn('testIsCheck2', intType); | 763 checkReturn('testIsCheck2', intType); |
764 checkReturn('testIsCheck3', intType.nullable()); | 764 checkReturn('testIsCheck3', intType.nullable()); |
765 checkReturn('testIsCheck4', intType); | 765 checkReturn('testIsCheck4', intType); |
766 checkReturn('testIsCheck5', intType); | 766 checkReturn('testIsCheck5', intType); |
767 checkReturn('testIsCheck6', typesTask.dynamicType); | 767 checkReturn('testIsCheck6', typesTask.dynamicType); |
768 checkReturn('testIsCheck7', intType); | 768 checkReturn('testIsCheck7', intType); |
769 checkReturn('testIsCheck8', typesTask.dynamicType); | 769 checkReturn('testIsCheck8', typesTask.dynamicType); |
770 checkReturn('testIsCheck9', intType); | 770 checkReturn('testIsCheck9', intType); |
771 checkReturn('testIsCheck10', typesTask.dynamicType); | 771 checkReturn('testIsCheck10', typesTask.dynamicType); |
(...skipping 11 matching lines...) Expand all Loading... |
783 checkReturn('testIsCheck22', typesTask.dynamicType); | 783 checkReturn('testIsCheck22', typesTask.dynamicType); |
784 checkReturn('testIsCheck23', intType); | 784 checkReturn('testIsCheck23', intType); |
785 checkReturn('testIsCheck24', intType); | 785 checkReturn('testIsCheck24', intType); |
786 checkReturn('testIsCheck25', typesTask.dynamicType); | 786 checkReturn('testIsCheck25', typesTask.dynamicType); |
787 checkReturn('testIsCheck26', intType); | 787 checkReturn('testIsCheck26', intType); |
788 checkReturn('testIsCheck27', intType); | 788 checkReturn('testIsCheck27', intType); |
789 checkReturn('testIsCheck28', typesTask.dynamicType); | 789 checkReturn('testIsCheck28', typesTask.dynamicType); |
790 checkReturn('testIsCheck29', typesTask.dynamicType); | 790 checkReturn('testIsCheck29', typesTask.dynamicType); |
791 checkReturn('testIf1', typesTask.uint31Type.nullable()); | 791 checkReturn('testIf1', typesTask.uint31Type.nullable()); |
792 checkReturn('testIf2', typesTask.uint31Type.nullable()); | 792 checkReturn('testIf2', typesTask.uint31Type.nullable()); |
793 checkReturn('returnAsString', | 793 checkReturn('returnAsString', new TypeMask.subtype( |
794 new TypeMask.subtype(compiler.stringClass, compiler.world)); | 794 compiler.coreClasses.stringClass, compiler.world)); |
795 checkReturn('returnIntAsNum', typesTask.uint31Type); | 795 checkReturn('returnIntAsNum', typesTask.uint31Type); |
796 checkReturn('returnAsTypedef', typesTask.functionType.nullable()); | 796 checkReturn('returnAsTypedef', typesTask.functionType.nullable()); |
797 checkReturn('returnTopLevelGetter', typesTask.uint31Type); | 797 checkReturn('returnTopLevelGetter', typesTask.uint31Type); |
798 checkReturn('testDeadCode', typesTask.uint31Type); | 798 checkReturn('testDeadCode', typesTask.uint31Type); |
799 checkReturn('testLabeledIf', typesTask.uint31Type.nullable()); | 799 checkReturn('testLabeledIf', typesTask.uint31Type.nullable()); |
800 checkReturn('testSwitch1', simplify( | 800 checkReturn('testSwitch1', simplify( |
801 typesTask.intType | 801 typesTask.intType |
802 .union(typesTask.doubleType, compiler.world) | 802 .union(typesTask.doubleType, compiler.world) |
803 .nullable(), | 803 .nullable(), |
804 compiler)); | 804 compiler)); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 checkReturn('testSpecialization3', typesTask.uint31Type.nullable()); | 869 checkReturn('testSpecialization3', typesTask.uint31Type.nullable()); |
870 checkReturn('testReturnNull1', typesTask.nullType); | 870 checkReturn('testReturnNull1', typesTask.nullType); |
871 checkReturn('testReturnNull2', typesTask.nullType); | 871 checkReturn('testReturnNull2', typesTask.nullType); |
872 checkReturn('testReturnNull3', typesTask.dynamicType); | 872 checkReturn('testReturnNull3', typesTask.dynamicType); |
873 checkReturn('testReturnNull4', typesTask.nullType); | 873 checkReturn('testReturnNull4', typesTask.nullType); |
874 checkReturn('testReturnNull5', typesTask.nullType); | 874 checkReturn('testReturnNull5', typesTask.nullType); |
875 checkReturn('testReturnNull6', typesTask.dynamicType); | 875 checkReturn('testReturnNull6', typesTask.dynamicType); |
876 checkReturn('testReturnNotEquals', typesTask.boolType); | 876 checkReturn('testReturnNotEquals', typesTask.boolType); |
877 })); | 877 })); |
878 } | 878 } |
OLD | NEW |