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 | 8 |
9 import 'compiler_helper.dart'; | 9 import 'compiler_helper.dart'; |
10 import 'type_mask_test_helper.dart'; | 10 import 'type_mask_test_helper.dart'; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 returnInt6(); | 160 returnInt6(); |
161 returnDyn6(); | 161 returnDyn6(); |
162 returnInt7(); | 162 returnInt7(); |
163 } | 163 } |
164 """; | 164 """; |
165 | 165 |
166 void main() { | 166 void main() { |
167 Uri uri = new Uri(scheme: 'source'); | 167 Uri uri = new Uri(scheme: 'source'); |
168 var compiler = compilerFor(TEST, uri); | 168 var compiler = compilerFor(TEST, uri); |
169 asyncTest(() => compiler.run(uri).then((_) { | 169 asyncTest(() => compiler.run(uri).then((_) { |
170 var commonMasks = compiler.commonMasks; | 170 var commonMasks = compiler.closedWorld.commonMasks; |
171 var typesInferrer = compiler.globalInference.typesInferrer; | 171 var typesInferrer = compiler.globalInference.typesInferrerInternal; |
172 | 172 |
173 checkReturn(String name, type) { | 173 checkReturn(String name, type) { |
174 var element = findElement(compiler, name); | 174 var element = findElement(compiler, name); |
175 Expect.equals( | 175 Expect.equals( |
176 type, | 176 type, |
177 simplify( | 177 simplify( |
178 typesInferrer.getReturnTypeOfElement(element), compiler)); | 178 typesInferrer.getReturnTypeOfElement(element), compiler)); |
179 } | 179 } |
180 | 180 |
181 checkReturn('returnInt1', commonMasks.uint31Type); | 181 checkReturn('returnInt1', commonMasks.uint31Type); |
(...skipping 10 matching lines...) Expand all Loading... |
192 findTypeMask(compiler, 'Interceptor', 'nonNullSubclass'); | 192 findTypeMask(compiler, 'Interceptor', 'nonNullSubclass'); |
193 | 193 |
194 checkReturn('returnDyn1', subclassOfInterceptor); | 194 checkReturn('returnDyn1', subclassOfInterceptor); |
195 checkReturn('returnDyn2', subclassOfInterceptor); | 195 checkReturn('returnDyn2', subclassOfInterceptor); |
196 checkReturn('returnDyn3', subclassOfInterceptor); | 196 checkReturn('returnDyn3', subclassOfInterceptor); |
197 checkReturn('returnDyn4', subclassOfInterceptor); | 197 checkReturn('returnDyn4', subclassOfInterceptor); |
198 checkReturn('returnDyn5', subclassOfInterceptor); | 198 checkReturn('returnDyn5', subclassOfInterceptor); |
199 checkReturn('returnDyn6', commonMasks.dynamicType); | 199 checkReturn('returnDyn6', commonMasks.dynamicType); |
200 })); | 200 })); |
201 } | 201 } |
OLD | NEW |