| 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 operator[](Node node); | 8 Element operator[](Node node); |
| 9 Selector getSelector(Send send); | 9 Selector getSelector(Send send); |
| 10 DartType getType(Node node); | 10 DartType getType(Node node); |
| (...skipping 3207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3218 DartType returnType = compiler.resolveReturnType(element, returnNode); | 3218 DartType returnType = compiler.resolveReturnType(element, returnNode); |
| 3219 if (element.isSetter() && (requiredParameterCount != 1 || | 3219 if (element.isSetter() && (requiredParameterCount != 1 || |
| 3220 visitor.optionalParameterCount != 0)) { | 3220 visitor.optionalParameterCount != 0)) { |
| 3221 // If there are no formal parameters, we already reported an error above. | 3221 // If there are no formal parameters, we already reported an error above. |
| 3222 if (formalParameters != null) { | 3222 if (formalParameters != null) { |
| 3223 compiler.reportMessage(compiler.spanFromSpannable(formalParameters), | 3223 compiler.reportMessage(compiler.spanFromSpannable(formalParameters), |
| 3224 MessageKind.ILLEGAL_SETTER_FORMALS.error([]), | 3224 MessageKind.ILLEGAL_SETTER_FORMALS.error([]), |
| 3225 Diagnostic.ERROR); | 3225 Diagnostic.ERROR); |
| 3226 } | 3226 } |
| 3227 } | 3227 } |
| 3228 if (element.isGetter() && (requiredParameterCount != 0 |
| 3229 || visitor.optionalParameterCount != 0)) { |
| 3230 compiler.reportMessage(compiler.spanFromSpannable(formalParameters), |
| 3231 MessageKind.EXTRA_FORMALS.error([]), |
| 3232 Diagnostic.ERROR); |
| 3233 } |
| 3228 return new FunctionSignatureX(parameters, | 3234 return new FunctionSignatureX(parameters, |
| 3229 visitor.optionalParameters, | 3235 visitor.optionalParameters, |
| 3230 requiredParameterCount, | 3236 requiredParameterCount, |
| 3231 visitor.optionalParameterCount, | 3237 visitor.optionalParameterCount, |
| 3232 visitor.optionalParametersAreNamed, | 3238 visitor.optionalParametersAreNamed, |
| 3233 returnType); | 3239 returnType); |
| 3234 } | 3240 } |
| 3235 | 3241 |
| 3236 // TODO(ahe): This is temporary. | 3242 // TODO(ahe): This is temporary. |
| 3237 void resolveExpression(Node node) { | 3243 void resolveExpression(Node node) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3397 return e; | 3403 return e; |
| 3398 } | 3404 } |
| 3399 | 3405 |
| 3400 /// Assumed to be called by [resolveRedirectingFactory]. | 3406 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3401 Element visitReturn(Return node) { | 3407 Element visitReturn(Return node) { |
| 3402 Node expression = node.expression; | 3408 Node expression = node.expression; |
| 3403 return finishConstructorReference(visit(expression), | 3409 return finishConstructorReference(visit(expression), |
| 3404 expression, expression); | 3410 expression, expression); |
| 3405 } | 3411 } |
| 3406 } | 3412 } |
| OLD | NEW |