| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.resolution.class_hierarchy; | 5 library dart2js.resolution.class_hierarchy; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show Resolution; | 8 import '../common/resolution.dart' show Resolution; |
| 9 import '../common_elements.dart' show CommonElements; | 9 import '../common_elements.dart' show CommonElements; |
| 10 import '../elements/resolution_types.dart'; | 10 import '../elements/resolution_types.dart'; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 MessageKind kind = MessageKind.SUPER_CALL_TO_FACTORY; | 195 MessageKind kind = MessageKind.SUPER_CALL_TO_FACTORY; |
| 196 Map arguments = {'className': element.superclass.name}; | 196 Map arguments = {'className': element.superclass.name}; |
| 197 // TODO(ahe): Why is this a compile-time error? Or if it is an error, | 197 // TODO(ahe): Why is this a compile-time error? Or if it is an error, |
| 198 // why do we bother to registerThrowNoSuchMethod below? | 198 // why do we bother to registerThrowNoSuchMethod below? |
| 199 reporter.reportErrorMessage(node, kind, arguments); | 199 reporter.reportErrorMessage(node, kind, arguments); |
| 200 superMember = new ErroneousElementX(kind, arguments, '', element); | 200 superMember = new ErroneousElementX(kind, arguments, '', element); |
| 201 registry.registerFeature(Feature.THROW_NO_SUCH_METHOD); | 201 registry.registerFeature(Feature.THROW_NO_SUCH_METHOD); |
| 202 } else { | 202 } else { |
| 203 ConstructorElement superConstructor = superMember; | 203 ConstructorElement superConstructor = superMember; |
| 204 superConstructor.computeType(resolution); | 204 superConstructor.computeType(resolution); |
| 205 if (!CallStructure.NO_ARGS.signatureApplies(superConstructor.type)) { | 205 if (!CallStructure.NO_ARGS |
| 206 .signatureApplies(superConstructor.parameterStructure)) { |
| 206 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; | 207 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; |
| 207 reporter.reportErrorMessage(node, kind); | 208 reporter.reportErrorMessage(node, kind); |
| 208 superMember = new ErroneousElementX(kind, {}, '', element); | 209 superMember = new ErroneousElementX(kind, {}, '', element); |
| 209 } | 210 } |
| 210 } | 211 } |
| 211 FunctionElement constructor = | 212 FunctionElement constructor = |
| 212 new SynthesizedConstructorElementX.forDefault(superMember, element); | 213 new SynthesizedConstructorElementX.forDefault(superMember, element); |
| 213 if (superMember.isMalformed) { | 214 if (superMember.isMalformed) { |
| 214 ErroneousElement erroneousElement = superMember; | 215 ErroneousElement erroneousElement = superMember; |
| 215 resolution.registerCompileTimeError( | 216 resolution.registerCompileTimeError( |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 Identifier selector = node.selector.asIdentifier(); | 644 Identifier selector = node.selector.asIdentifier(); |
| 644 var e = prefixElement.lookupLocalMember(selector.source); | 645 var e = prefixElement.lookupLocalMember(selector.source); |
| 645 if (e == null || !e.impliesType) { | 646 if (e == null || !e.impliesType) { |
| 646 reporter.reportErrorMessage(node.selector, | 647 reporter.reportErrorMessage(node.selector, |
| 647 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); | 648 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); |
| 648 return; | 649 return; |
| 649 } | 650 } |
| 650 loadSupertype(e, node); | 651 loadSupertype(e, node); |
| 651 } | 652 } |
| 652 } | 653 } |
| OLD | NEW |