| 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 |
| 9 Feature; |
| 8 import '../compiler.dart' show | 10 import '../compiler.dart' show |
| 9 Compiler; | 11 Compiler; |
| 10 import '../core_types.dart' show | 12 import '../core_types.dart' show |
| 11 CoreClasses, | 13 CoreClasses, |
| 12 CoreTypes; | 14 CoreTypes; |
| 13 import '../dart_types.dart'; | 15 import '../dart_types.dart'; |
| 14 import '../elements/elements.dart'; | 16 import '../elements/elements.dart'; |
| 15 import '../elements/modelx.dart' show | 17 import '../elements/modelx.dart' show |
| 16 BaseClassElementX, | 18 BaseClassElementX, |
| 17 ErroneousElementX, | 19 ErroneousElementX, |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 if (!element.hasConstructor) { | 196 if (!element.hasConstructor) { |
| 195 Element superMember = element.superclass.localLookup(''); | 197 Element superMember = element.superclass.localLookup(''); |
| 196 if (superMember == null) { | 198 if (superMember == null) { |
| 197 MessageKind kind = MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR; | 199 MessageKind kind = MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR; |
| 198 Map arguments = {'className': element.superclass.name}; | 200 Map arguments = {'className': element.superclass.name}; |
| 199 // TODO(ahe): Why is this a compile-time error? Or if it is an error, | 201 // TODO(ahe): Why is this a compile-time error? Or if it is an error, |
| 200 // why do we bother to registerThrowNoSuchMethod below? | 202 // why do we bother to registerThrowNoSuchMethod below? |
| 201 reporter.reportErrorMessage(node, kind, arguments); | 203 reporter.reportErrorMessage(node, kind, arguments); |
| 202 superMember = new ErroneousElementX( | 204 superMember = new ErroneousElementX( |
| 203 kind, arguments, '', element); | 205 kind, arguments, '', element); |
| 204 registry.registerThrowNoSuchMethod(); | 206 registry.registerFeature(Feature.THROW_NO_SUCH_METHOD); |
| 205 } else if (!superMember.isGenerativeConstructor) { | 207 } else if (!superMember.isGenerativeConstructor) { |
| 206 MessageKind kind = MessageKind.SUPER_CALL_TO_FACTORY; | 208 MessageKind kind = MessageKind.SUPER_CALL_TO_FACTORY; |
| 207 Map arguments = {'className': element.superclass.name}; | 209 Map arguments = {'className': element.superclass.name}; |
| 208 // TODO(ahe): Why is this a compile-time error? Or if it is an error, | 210 // TODO(ahe): Why is this a compile-time error? Or if it is an error, |
| 209 // why do we bother to registerThrowNoSuchMethod below? | 211 // why do we bother to registerThrowNoSuchMethod below? |
| 210 reporter.reportErrorMessage(node, kind, arguments); | 212 reporter.reportErrorMessage(node, kind, arguments); |
| 211 superMember = new ErroneousElementX( | 213 superMember = new ErroneousElementX( |
| 212 kind, arguments, '', element); | 214 kind, arguments, '', element); |
| 213 registry.registerThrowNoSuchMethod(); | 215 registry.registerFeature(Feature.THROW_NO_SUCH_METHOD); |
| 214 } else { | 216 } else { |
| 215 ConstructorElement superConstructor = superMember; | 217 ConstructorElement superConstructor = superMember; |
| 216 superConstructor.computeType(resolution); | 218 superConstructor.computeType(resolution); |
| 217 if (!CallStructure.NO_ARGS.signatureApplies( | 219 if (!CallStructure.NO_ARGS.signatureApplies( |
| 218 superConstructor.functionSignature)) { | 220 superConstructor.functionSignature)) { |
| 219 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; | 221 MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT; |
| 220 reporter.reportErrorMessage(node, kind); | 222 reporter.reportErrorMessage(node, kind); |
| 221 superMember = new ErroneousElementX(kind, {}, '', element); | 223 superMember = new ErroneousElementX(kind, {}, '', element); |
| 222 } | 224 } |
| 223 } | 225 } |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 if (e == null || !e.impliesType) { | 718 if (e == null || !e.impliesType) { |
| 717 reporter.reportErrorMessage( | 719 reporter.reportErrorMessage( |
| 718 node.selector, | 720 node.selector, |
| 719 MessageKind.CANNOT_RESOLVE_TYPE, | 721 MessageKind.CANNOT_RESOLVE_TYPE, |
| 720 {'typeName': node.selector}); | 722 {'typeName': node.selector}); |
| 721 return; | 723 return; |
| 722 } | 724 } |
| 723 loadSupertype(e, node); | 725 loadSupertype(e, node); |
| 724 } | 726 } |
| 725 } | 727 } |
| OLD | NEW |