| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 class InitializerResolver { | 7 class InitializerResolver { |
| 8 final ResolverVisitor visitor; | 8 final ResolverVisitor visitor; |
| 9 final ConstructorElementX constructor; | 9 final ConstructorElementX constructor; |
| 10 final FunctionExpression functionNode; | 10 final FunctionExpression functionNode; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 String fullConstructorName = Elements.constructorNameForDiagnostics( | 214 String fullConstructorName = Elements.constructorNameForDiagnostics( |
| 215 className, | 215 className, |
| 216 constructorSelector.name); | 216 constructorSelector.name); |
| 217 MessageKind kind = isImplicitSuperCall | 217 MessageKind kind = isImplicitSuperCall |
| 218 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT | 218 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT |
| 219 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; | 219 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; |
| 220 visitor.compiler.reportError( | 220 visitor.compiler.reportError( |
| 221 diagnosticNode, kind, {'constructorName': fullConstructorName}); | 221 diagnosticNode, kind, {'constructorName': fullConstructorName}); |
| 222 isValidAsConstant = false; | 222 isValidAsConstant = false; |
| 223 } else { | 223 } else { |
| 224 lookedupConstructor.computeSignature(visitor.compiler); | 224 lookedupConstructor.computeType(visitor.compiler); |
| 225 if (!call.signatureApplies(lookedupConstructor.functionSignature)) { | 225 if (!call.signatureApplies(lookedupConstructor.functionSignature)) { |
| 226 MessageKind kind = isImplicitSuperCall | 226 MessageKind kind = isImplicitSuperCall |
| 227 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT | 227 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT |
| 228 : MessageKind.NO_MATCHING_CONSTRUCTOR; | 228 : MessageKind.NO_MATCHING_CONSTRUCTOR; |
| 229 visitor.compiler.reportError(diagnosticNode, kind); | 229 visitor.compiler.reportError(diagnosticNode, kind); |
| 230 isValidAsConstant = false; | 230 isValidAsConstant = false; |
| 231 } else if (constructor.isConst | 231 } else if (constructor.isConst |
| 232 && !lookedupConstructor.isConst) { | 232 && !lookedupConstructor.isConst) { |
| 233 MessageKind kind = isImplicitSuperCall | 233 MessageKind kind = isImplicitSuperCall |
| 234 ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT | 234 ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 return element; | 572 return element; |
| 573 } | 573 } |
| 574 | 574 |
| 575 /// Assumed to be called by [resolveRedirectingFactory]. | 575 /// Assumed to be called by [resolveRedirectingFactory]. |
| 576 Element visitRedirectingFactoryBody(RedirectingFactoryBody node) { | 576 Element visitRedirectingFactoryBody(RedirectingFactoryBody node) { |
| 577 Node constructorReference = node.constructorReference; | 577 Node constructorReference = node.constructorReference; |
| 578 return finishConstructorReference(visit(constructorReference), | 578 return finishConstructorReference(visit(constructorReference), |
| 579 constructorReference, node); | 579 constructorReference, node); |
| 580 } | 580 } |
| 581 } | 581 } |
| OLD | NEW |