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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 testReturnNull5(); | 719 testReturnNull5(); |
720 testReturnNull6(); | 720 testReturnNull6(); |
721 testReturnNotEquals(); | 721 testReturnNotEquals(); |
722 } | 722 } |
723 """; | 723 """; |
724 | 724 |
725 void main() { | 725 void main() { |
726 Uri uri = new Uri(scheme: 'source'); | 726 Uri uri = new Uri(scheme: 'source'); |
727 var compiler = compilerFor(TEST, uri); | 727 var compiler = compilerFor(TEST, uri); |
728 compiler.diagnosticHandler = createHandler(compiler, TEST); | 728 compiler.diagnosticHandler = createHandler(compiler, TEST); |
729 asyncTest(() => compiler.runCompiler(uri).then((_) { | 729 asyncTest(() => compiler.run(uri).then((_) { |
730 var typesTask = compiler.typesTask; | 730 var typesTask = compiler.typesTask; |
731 var typesInferrer = typesTask.typesInferrer; | 731 var typesInferrer = typesTask.typesInferrer; |
732 var world = compiler.world; | 732 var world = compiler.world; |
733 | 733 |
734 checkReturn(String name, type) { | 734 checkReturn(String name, type) { |
735 var element = findElement(compiler, name); | 735 var element = findElement(compiler, name); |
736 Expect.equals( | 736 Expect.equals( |
737 type, | 737 type, |
738 simplify(typesInferrer.getReturnTypeOfElement(element), compiler), | 738 simplify(typesInferrer.getReturnTypeOfElement(element), compiler), |
739 name); | 739 name); |
(...skipping 129 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 |