| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 Element get currentElement; | 8 Element get currentElement; |
| 9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 Selector constructorSelector) { | 1136 Selector constructorSelector) { |
| 1137 if (lookedupConstructor == null | 1137 if (lookedupConstructor == null |
| 1138 || !lookedupConstructor.isGenerativeConstructor()) { | 1138 || !lookedupConstructor.isGenerativeConstructor()) { |
| 1139 var fullConstructorName = | 1139 var fullConstructorName = |
| 1140 visitor.compiler.resolver.constructorNameForDiagnostics( | 1140 visitor.compiler.resolver.constructorNameForDiagnostics( |
| 1141 className, | 1141 className, |
| 1142 constructorSelector.name); | 1142 constructorSelector.name); |
| 1143 MessageKind kind = isImplicitSuperCall | 1143 MessageKind kind = isImplicitSuperCall |
| 1144 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT | 1144 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT |
| 1145 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; | 1145 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; |
| 1146 error(diagnosticNode, kind, {'constructorName': fullConstructorName}); | 1146 visitor.compiler.reportErrorCode( |
| 1147 diagnosticNode, kind, {'constructorName': fullConstructorName}); |
| 1147 } else { | 1148 } else { |
| 1148 if (!call.applies(lookedupConstructor, visitor.compiler)) { | 1149 if (!call.applies(lookedupConstructor, visitor.compiler)) { |
| 1149 MessageKind kind = isImplicitSuperCall | 1150 MessageKind kind = isImplicitSuperCall |
| 1150 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT | 1151 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT |
| 1151 : MessageKind.NO_MATCHING_CONSTRUCTOR; | 1152 : MessageKind.NO_MATCHING_CONSTRUCTOR; |
| 1152 error(diagnosticNode, kind); | 1153 visitor.compiler.reportErrorCode(diagnosticNode, kind); |
| 1153 } | 1154 } |
| 1154 } | 1155 } |
| 1155 } | 1156 } |
| 1156 | 1157 |
| 1157 FunctionElement resolveRedirection(FunctionElement constructor, | 1158 FunctionElement resolveRedirection(FunctionElement constructor, |
| 1158 FunctionExpression functionNode) { | 1159 FunctionExpression functionNode) { |
| 1159 if (functionNode.initializers == null) return null; | 1160 if (functionNode.initializers == null) return null; |
| 1160 Link<Node> link = functionNode.initializers.nodes; | 1161 Link<Node> link = functionNode.initializers.nodes; |
| 1161 if (!link.isEmpty && Initializers.isConstructorRedirect(link.head)) { | 1162 if (!link.isEmpty && Initializers.isConstructorRedirect(link.head)) { |
| 1162 return resolveSuperOrThisForSend(constructor, functionNode, link.head); | 1163 return resolveSuperOrThisForSend(constructor, functionNode, link.head); |
| (...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4054 return e; | 4055 return e; |
| 4055 } | 4056 } |
| 4056 | 4057 |
| 4057 /// Assumed to be called by [resolveRedirectingFactory]. | 4058 /// Assumed to be called by [resolveRedirectingFactory]. |
| 4058 Element visitReturn(Return node) { | 4059 Element visitReturn(Return node) { |
| 4059 Node expression = node.expression; | 4060 Node expression = node.expression; |
| 4060 return finishConstructorReference(visit(expression), | 4061 return finishConstructorReference(visit(expression), |
| 4061 expression, expression); | 4062 expression, expression); |
| 4062 } | 4063 } |
| 4063 } | 4064 } |
| OLD | NEW |