| 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 'parser_helper.dart' show buildSourceString; | 8 import 'parser_helper.dart' show buildSourceString; |
| 9 | 9 |
| 10 const String TEST = """ | 10 const String TEST = """ |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 checkReturn('returnDyn3', compiler.typesTask.dynamicType.nonNullable()); | 138 checkReturn('returnDyn3', compiler.typesTask.dynamicType.nonNullable()); |
| 139 checkReturn('returnNum1', compiler.typesTask.numType); | 139 checkReturn('returnNum1', compiler.typesTask.numType); |
| 140 | 140 |
| 141 checkReturnInClass(String className, String methodName, type) { | 141 checkReturnInClass(String className, String methodName, type) { |
| 142 var cls = findElement(compiler, className); | 142 var cls = findElement(compiler, className); |
| 143 var element = cls.lookupLocalMember(buildSourceString(methodName)); | 143 var element = cls.lookupLocalMember(buildSourceString(methodName)); |
| 144 Expect.equals(type, | 144 Expect.equals(type, |
| 145 typesInferrer.getReturnTypeOfElement(element).simplify(compiler)); | 145 typesInferrer.getReturnTypeOfElement(element).simplify(compiler)); |
| 146 } | 146 } |
| 147 var cls = findElement(compiler, 'A'); | 147 var cls = findElement(compiler, 'A'); |
| 148 checkReturnInClass('A', 'foo', new TypeMask.nonNullExact(cls.rawType)); | 148 checkReturnInClass('A', 'foo', new TypeMask.nonNullExact(cls)); |
| 149 })); | 149 })); |
| 150 } | 150 } |
| OLD | NEW |