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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 checkReturn('returnNum1', compiler.commonMasks.numType); | 140 checkReturn('returnNum1', compiler.commonMasks.numType); |
141 | 141 |
142 checkReturnInClass(String className, String methodName, type) { | 142 checkReturnInClass(String className, String methodName, type) { |
143 var cls = findElement(compiler, className); | 143 var cls = findElement(compiler, className); |
144 var element = cls.lookupLocalMember(methodName); | 144 var element = cls.lookupLocalMember(methodName); |
145 Expect.equals(type, | 145 Expect.equals(type, |
146 simplify(typesInferrer.getReturnTypeOfElement(element), compiler)); | 146 simplify(typesInferrer.getReturnTypeOfElement(element), compiler)); |
147 } | 147 } |
148 var cls = findElement(compiler, 'A'); | 148 var cls = findElement(compiler, 'A'); |
149 checkReturnInClass('A', 'foo', new TypeMask.nonNullExact(cls, | 149 checkReturnInClass('A', 'foo', new TypeMask.nonNullExact(cls, |
150 compiler.world)); | 150 compiler.closedWorld)); |
151 })); | 151 })); |
152 } | 152 } |
OLD | NEW |