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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 'returnInt6', commonMasks.uint32Type); // uint31+uint31->uint32 | 754 'returnInt6', commonMasks.uint32Type); // uint31+uint31->uint32 |
755 checkReturn('returnIntOrNull', commonMasks.uint31Type.nullable()); | 755 checkReturn('returnIntOrNull', commonMasks.uint31Type.nullable()); |
756 checkReturn('returnInt3', commonMasks.uint31Type); | 756 checkReturn('returnInt3', commonMasks.uint31Type); |
757 checkReturn('returnDynamic', commonMasks.dynamicType); | 757 checkReturn('returnDynamic', commonMasks.dynamicType); |
758 checkReturn('returnInt4', commonMasks.uint31Type); | 758 checkReturn('returnInt4', commonMasks.uint31Type); |
759 checkReturn('returnInt7', commonMasks.positiveIntType); | 759 checkReturn('returnInt7', commonMasks.positiveIntType); |
760 checkReturn('returnInt8', commonMasks.positiveIntType); | 760 checkReturn('returnInt8', commonMasks.positiveIntType); |
761 checkReturn('returnEmpty1', const TypeMask.nonNullEmpty()); | 761 checkReturn('returnEmpty1', const TypeMask.nonNullEmpty()); |
762 checkReturn('returnEmpty2', const TypeMask.nonNullEmpty()); | 762 checkReturn('returnEmpty2', const TypeMask.nonNullEmpty()); |
763 TypeMask intType = new TypeMask.nonNullSubtype( | 763 TypeMask intType = new TypeMask.nonNullSubtype( |
764 compiler.commonElements.intClass, closedWorld); | 764 closedWorld.commonElements.intClass, closedWorld); |
765 checkReturn('testIsCheck1', intType); | 765 checkReturn('testIsCheck1', intType); |
766 checkReturn('testIsCheck2', intType); | 766 checkReturn('testIsCheck2', intType); |
767 checkReturn('testIsCheck3', intType.nullable()); | 767 checkReturn('testIsCheck3', intType.nullable()); |
768 checkReturn('testIsCheck4', intType); | 768 checkReturn('testIsCheck4', intType); |
769 checkReturn('testIsCheck5', intType); | 769 checkReturn('testIsCheck5', intType); |
770 checkReturn('testIsCheck6', commonMasks.dynamicType); | 770 checkReturn('testIsCheck6', commonMasks.dynamicType); |
771 checkReturn('testIsCheck7', intType); | 771 checkReturn('testIsCheck7', intType); |
772 checkReturn('testIsCheck8', commonMasks.dynamicType); | 772 checkReturn('testIsCheck8', commonMasks.dynamicType); |
773 checkReturn('testIsCheck9', intType); | 773 checkReturn('testIsCheck9', intType); |
774 checkReturn('testIsCheck10', commonMasks.dynamicType); | 774 checkReturn('testIsCheck10', commonMasks.dynamicType); |
(...skipping 15 matching lines...) Expand all Loading... |
790 checkReturn('testIsCheck25', commonMasks.dynamicType); | 790 checkReturn('testIsCheck25', commonMasks.dynamicType); |
791 checkReturn('testIsCheck26', intType); | 791 checkReturn('testIsCheck26', intType); |
792 checkReturn('testIsCheck27', intType); | 792 checkReturn('testIsCheck27', intType); |
793 checkReturn('testIsCheck28', commonMasks.dynamicType); | 793 checkReturn('testIsCheck28', commonMasks.dynamicType); |
794 checkReturn('testIsCheck29', commonMasks.dynamicType); | 794 checkReturn('testIsCheck29', commonMasks.dynamicType); |
795 checkReturn('testIf1', commonMasks.uint31Type.nullable()); | 795 checkReturn('testIf1', commonMasks.uint31Type.nullable()); |
796 checkReturn('testIf2', commonMasks.uint31Type.nullable()); | 796 checkReturn('testIf2', commonMasks.uint31Type.nullable()); |
797 checkReturn( | 797 checkReturn( |
798 'returnAsString', | 798 'returnAsString', |
799 new TypeMask.subtype( | 799 new TypeMask.subtype( |
800 compiler.commonElements.stringClass, closedWorld)); | 800 closedWorld.commonElements.stringClass, closedWorld)); |
801 checkReturn('returnIntAsNum', commonMasks.uint31Type); | 801 checkReturn('returnIntAsNum', commonMasks.uint31Type); |
802 checkReturn('returnAsTypedef', commonMasks.functionType.nullable()); | 802 checkReturn('returnAsTypedef', commonMasks.functionType.nullable()); |
803 checkReturn('returnTopLevelGetter', commonMasks.uint31Type); | 803 checkReturn('returnTopLevelGetter', commonMasks.uint31Type); |
804 checkReturn('testDeadCode', commonMasks.uint31Type); | 804 checkReturn('testDeadCode', commonMasks.uint31Type); |
805 checkReturn('testLabeledIf', commonMasks.uint31Type.nullable()); | 805 checkReturn('testLabeledIf', commonMasks.uint31Type.nullable()); |
806 checkReturn( | 806 checkReturn( |
807 'testSwitch1', | 807 'testSwitch1', |
808 simplify( | 808 simplify( |
809 commonMasks.intType | 809 commonMasks.intType |
810 .union(commonMasks.doubleType, closedWorld) | 810 .union(commonMasks.doubleType, closedWorld) |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 checkReturn('testSpecialization3', commonMasks.uint31Type.nullable()); | 881 checkReturn('testSpecialization3', commonMasks.uint31Type.nullable()); |
882 checkReturn('testReturnNull1', commonMasks.nullType); | 882 checkReturn('testReturnNull1', commonMasks.nullType); |
883 checkReturn('testReturnNull2', commonMasks.nullType); | 883 checkReturn('testReturnNull2', commonMasks.nullType); |
884 checkReturn('testReturnNull3', commonMasks.dynamicType); | 884 checkReturn('testReturnNull3', commonMasks.dynamicType); |
885 checkReturn('testReturnNull4', commonMasks.nullType); | 885 checkReturn('testReturnNull4', commonMasks.nullType); |
886 checkReturn('testReturnNull5', commonMasks.nullType); | 886 checkReturn('testReturnNull5', commonMasks.nullType); |
887 checkReturn('testReturnNull6', commonMasks.dynamicType); | 887 checkReturn('testReturnNull6', commonMasks.dynamicType); |
888 checkReturn('testReturnNotEquals', commonMasks.boolType); | 888 checkReturn('testReturnNotEquals', commonMasks.boolType); |
889 })); | 889 })); |
890 } | 890 } |
OLD | NEW |