| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 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 'package:compiler/src/resolution/class_members.dart' show MembersCreator; | 8 import 'package:compiler/src/resolution/class_members.dart' show MembersCreator; |
| 9 | 9 |
| 10 main() { | 10 main() { |
| 11 asyncTest(() => Future.wait([ | 11 asyncTest(() => Future.wait([ |
| 12 testRequiredParameters(), | 12 testRequiredParameters(), |
| 13 testPositionalParameters(), | 13 testPositionalParameters(), |
| 14 testNamedParameters(), | 14 testNamedParameters(), |
| 15 testNotSubtype(), | 15 testNotSubtype(), |
| 16 testGetterNotSubtype(), | 16 testGetterNotSubtype(), |
| 17 testSetterNotSubtype(), | 17 testSetterNotSubtype(), |
| 18 testGenericNotSubtype(), | 18 testGenericNotSubtype(), |
| 19 testFieldNotSubtype(), | 19 testFieldNotSubtype(), |
| 20 testMixedOverride(), | 20 testMixedOverride(), |
| 21 testAbstractMethods(), | 21 testAbstractMethods(), |
| 22 testNoSuchMethod(), | 22 testNoSuchMethod(), |
| 23 ])); | 23 ])); |
| 24 } | 24 } |
| 25 | 25 |
| 26 Future check(String source, {errors, warnings, hints, infos}) { | 26 Future check(String source, {errors, warnings, hints, infos}) { |
| 27 return MockCompiler.create((MockCompiler compiler) { | 27 return MockCompiler.create((MockCompiler compiler) { |
| 28 compiler.diagnosticHandler = createHandler(compiler, source); | 28 compiler.diagnosticHandler = createHandler(compiler, source); |
| 29 compiler.parseScript(source); | 29 compiler.parseScript(source); |
| 30 var mainApp = compiler.mainApp; | 30 dynamic mainApp = compiler.mainApp; |
| 31 var cls = mainApp.find('Class'); | 31 var cls = mainApp.find('Class'); |
| 32 cls.ensureResolved(compiler.resolution); | 32 cls.ensureResolved(compiler.resolution); |
| 33 MembersCreator.computeAllClassMembers(compiler.resolution, cls); | 33 MembersCreator.computeAllClassMembers(compiler.resolution, cls); |
| 34 | 34 |
| 35 toList(o) => o == null ? [] : o is List ? o : [o]; | 35 toList(o) => o == null ? [] : o is List ? o : [o]; |
| 36 | 36 |
| 37 compareMessageKinds( | 37 compareMessageKinds( |
| 38 source, toList(errors), compiler.diagnosticCollector.errors, 'error'); | 38 source, toList(errors), compiler.diagnosticCollector.errors, 'error'); |
| 39 | 39 |
| 40 compareMessageKinds(source, toList(warnings), | 40 compareMessageKinds(source, toList(warnings), |
| (...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 check(""" | 1692 check(""" |
| 1693 class A { | 1693 class A { |
| 1694 noSuchMethod(_) => null; | 1694 noSuchMethod(_) => null; |
| 1695 method(); // testNoSuchMethod:13 | 1695 method(); // testNoSuchMethod:13 |
| 1696 } | 1696 } |
| 1697 class Class extends A { | 1697 class Class extends A { |
| 1698 } | 1698 } |
| 1699 """), | 1699 """), |
| 1700 ]); | 1700 ]); |
| 1701 } | 1701 } |
| OLD | NEW |