| 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 '../core_types.dart' show CommonElements; | 9 import '../core_types.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 | 205 if (!CallStructure.NO_ARGS.signatureApplies(superConstructor.type)) { |
| 206 .signatureApplies(superConstructor.functionSignature)) { | |
| 207 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; | 206 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; |
| 208 reporter.reportErrorMessage(node, kind); | 207 reporter.reportErrorMessage(node, kind); |
| 209 superMember = new ErroneousElementX(kind, {}, '', element); | 208 superMember = new ErroneousElementX(kind, {}, '', element); |
| 210 } | 209 } |
| 211 } | 210 } |
| 212 FunctionElement constructor = | 211 FunctionElement constructor = |
| 213 new SynthesizedConstructorElementX.forDefault(superMember, element); | 212 new SynthesizedConstructorElementX.forDefault(superMember, element); |
| 214 if (superMember.isMalformed) { | 213 if (superMember.isMalformed) { |
| 215 ErroneousElement erroneousElement = superMember; | 214 ErroneousElement erroneousElement = superMember; |
| 216 resolution.registerCompileTimeError( | 215 resolution.registerCompileTimeError( |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 Identifier selector = node.selector.asIdentifier(); | 643 Identifier selector = node.selector.asIdentifier(); |
| 645 var e = prefixElement.lookupLocalMember(selector.source); | 644 var e = prefixElement.lookupLocalMember(selector.source); |
| 646 if (e == null || !e.impliesType) { | 645 if (e == null || !e.impliesType) { |
| 647 reporter.reportErrorMessage(node.selector, | 646 reporter.reportErrorMessage(node.selector, |
| 648 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); | 647 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); |
| 649 return; | 648 return; |
| 650 } | 649 } |
| 651 loadSupertype(e, node); | 650 loadSupertype(e, node); |
| 652 } | 651 } |
| 653 } | 652 } |
| OLD | NEW |