| 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 'compiler_helper.dart'; | 7 import 'compiler_helper.dart'; |
| 8 import 'type_mask_test_helper.dart'; | 8 import 'type_mask_test_helper.dart'; |
| 9 | 9 |
| 10 const String TEST = """ | 10 const String TEST = """ |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 checkReturn( | 140 checkReturn( |
| 141 'returnDyn1', closedWorld.commonMasks.dynamicType.nonNullable()); | 141 'returnDyn1', closedWorld.commonMasks.dynamicType.nonNullable()); |
| 142 checkReturn( | 142 checkReturn( |
| 143 'returnDyn2', closedWorld.commonMasks.dynamicType.nonNullable()); | 143 'returnDyn2', closedWorld.commonMasks.dynamicType.nonNullable()); |
| 144 checkReturn( | 144 checkReturn( |
| 145 'returnDyn3', closedWorld.commonMasks.dynamicType.nonNullable()); | 145 'returnDyn3', closedWorld.commonMasks.dynamicType.nonNullable()); |
| 146 checkReturn('returnNum1', closedWorld.commonMasks.numType); | 146 checkReturn('returnNum1', closedWorld.commonMasks.numType); |
| 147 | 147 |
| 148 checkReturnInClass(String className, String methodName, type) { | 148 checkReturnInClass(String className, String methodName, type) { |
| 149 var cls = findElement(compiler, className); | 149 dynamic cls = findElement(compiler, className); |
| 150 var element = cls.lookupLocalMember(methodName); | 150 var element = cls.lookupLocalMember(methodName); |
| 151 Expect.equals( | 151 Expect.equals( |
| 152 type, | 152 type, |
| 153 simplify( | 153 simplify( |
| 154 typesInferrer.getReturnTypeOfElement(element), closedWorld)); | 154 typesInferrer.getReturnTypeOfElement(element), closedWorld)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 var cls = findElement(compiler, 'A'); | 157 dynamic cls = findElement(compiler, 'A'); |
| 158 checkReturnInClass( | 158 checkReturnInClass( |
| 159 'A', 'foo', new TypeMask.nonNullExact(cls, closedWorld)); | 159 'A', 'foo', new TypeMask.nonNullExact(cls, closedWorld)); |
| 160 })); | 160 })); |
| 161 } | 161 } |
| OLD | NEW |