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 library universe; | 5 library universe; |
6 | 6 |
7 import '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
9 import '../dart2jslib.dart'; | 9 import '../dart2jslib.dart'; |
10 import '../runtime_types.dart'; | 10 import '../runtime_types.dart'; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 => appliesUntyped(element, compiler); | 224 => appliesUntyped(element, compiler); |
225 | 225 |
226 bool appliesUntyped(Element element, Compiler compiler) { | 226 bool appliesUntyped(Element element, Compiler compiler) { |
227 if (Elements.isUnresolved(element)) return false; | 227 if (Elements.isUnresolved(element)) return false; |
228 if (element.isForeign()) return true; | 228 if (element.isForeign()) return true; |
229 | 229 |
230 if (element.isSetter()) return isSetter(); | 230 if (element.isSetter()) return isSetter(); |
231 if (element.isGetter()) return isGetter() || isCall(); | 231 if (element.isGetter()) return isGetter() || isCall(); |
232 if (element.isField()) return isGetter() || isSetter() || isCall(); | 232 if (element.isField()) return isGetter() || isSetter() || isCall(); |
233 if (isGetter()) return true; | 233 if (isGetter()) return true; |
| 234 if (isSetter()) return false; |
234 | 235 |
235 FunctionElement function = element; | 236 FunctionElement function = element; |
236 FunctionSignature parameters = function.computeSignature(compiler); | 237 FunctionSignature parameters = function.computeSignature(compiler); |
237 if (argumentCount > parameters.parameterCount) return false; | 238 if (argumentCount > parameters.parameterCount) return false; |
238 int requiredParameterCount = parameters.requiredParameterCount; | 239 int requiredParameterCount = parameters.requiredParameterCount; |
239 int optionalParameterCount = parameters.optionalParameterCount; | 240 int optionalParameterCount = parameters.optionalParameterCount; |
240 if (positionalArgumentCount < requiredParameterCount) return false; | 241 if (positionalArgumentCount < requiredParameterCount) return false; |
241 | 242 |
242 if (!parameters.optionalParametersAreNamed) { | 243 if (!parameters.optionalParametersAreNamed) { |
243 // We have already checked that the number of arguments are | 244 // We have already checked that the number of arguments are |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // implementation of [element]. | 440 // implementation of [element]. |
440 if (self.isSubclassOf(other)) { | 441 if (self.isSubclassOf(other)) { |
441 // Resolve an invocation of [element.name] on [self]. If it | 442 // Resolve an invocation of [element.name] on [self]. If it |
442 // is found, this selector is a candidate. | 443 // is found, this selector is a candidate. |
443 return hasElementIn(self, element) && appliesUntyped(element, compiler); | 444 return hasElementIn(self, element) && appliesUntyped(element, compiler); |
444 } | 445 } |
445 | 446 |
446 return false; | 447 return false; |
447 } | 448 } |
448 } | 449 } |
OLD | NEW |