| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 | 9 |
| 10 import 'package:compiler/src/elements/resolution_types.dart'; | 10 import 'package:compiler/src/elements/resolution_types.dart'; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 testTypePromotionHints, | 64 testTypePromotionHints, |
| 65 testFunctionCall, | 65 testFunctionCall, |
| 66 testCascade, | 66 testCascade, |
| 67 testAwait, | 67 testAwait, |
| 68 testAsyncReturn | 68 testAsyncReturn |
| 69 ]; | 69 ]; |
| 70 asyncTest(() => Future.forEach(tests, (test) => setup(test))); | 70 asyncTest(() => Future.forEach(tests, (test) => setup(test))); |
| 71 } | 71 } |
| 72 | 72 |
| 73 testSimpleTypes(MockCompiler compiler) { | 73 testSimpleTypes(MockCompiler compiler) { |
| 74 checkType(ResolutionDartType type, String code) { | 74 checkType(ResolutionInterfaceType type, String code) { |
| 75 Expect.equals(type, analyzeType(compiler, code)); | 75 Expect.equals(type, analyzeType(compiler, code)); |
| 76 } | 76 } |
| 77 | 77 |
| 78 checkType(compiler.commonElements.intType, "3"); | 78 checkType(compiler.commonElements.intType, "3"); |
| 79 checkType(compiler.commonElements.boolType, "false"); | 79 checkType(compiler.commonElements.boolType, "false"); |
| 80 checkType(compiler.commonElements.boolType, "true"); | 80 checkType(compiler.commonElements.boolType, "true"); |
| 81 checkType(compiler.commonElements.stringType, "'hestfisk'"); | 81 checkType(compiler.commonElements.stringType, "'hestfisk'"); |
| 82 } | 82 } |
| 83 | 83 |
| 84 Future testReturn(MockCompiler compiler) { | 84 Future testReturn(MockCompiler compiler) { |
| (...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2775 TreeElements elements = compiler.resolveNodeStatement(node, element); | 2775 TreeElements elements = compiler.resolveNodeStatement(node, element); |
| 2776 TypeCheckerVisitor checker = | 2776 TypeCheckerVisitor checker = |
| 2777 new TypeCheckerVisitor(compiler, elements, compiler.types); | 2777 new TypeCheckerVisitor(compiler, elements, compiler.types); |
| 2778 DiagnosticCollector collector = compiler.diagnosticCollector; | 2778 DiagnosticCollector collector = compiler.diagnosticCollector; |
| 2779 collector.clear(); | 2779 collector.clear(); |
| 2780 checker.analyze(node, mustHaveType: false); | 2780 checker.analyze(node, mustHaveType: false); |
| 2781 generateOutput(compiler, text); | 2781 generateOutput(compiler, text); |
| 2782 compareWarningKinds(text, warnings, collector.warnings); | 2782 compareWarningKinds(text, warnings, collector.warnings); |
| 2783 compareWarningKinds(text, hints, collector.hints); | 2783 compareWarningKinds(text, hints, collector.hints); |
| 2784 } | 2784 } |
| OLD | NEW |