| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.generated.element_resolver; | 5 library analyzer.src.generated.element_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2221 if (element == null) { | 2221 if (element == null) { |
| 2222 // | 2222 // |
| 2223 // If there's no method, then it's possible that 'm' is a getter that | 2223 // If there's no method, then it's possible that 'm' is a getter that |
| 2224 // returns a function. | 2224 // returns a function. |
| 2225 // | 2225 // |
| 2226 // TODO (collinsn): need to add union type support here too, in the | 2226 // TODO (collinsn): need to add union type support here too, in the |
| 2227 // style of [lookUpMethod]. | 2227 // style of [lookUpMethod]. |
| 2228 element = _lookUpGetter(target, targetType, methodName.name); | 2228 element = _lookUpGetter(target, targetType, methodName.name); |
| 2229 } | 2229 } |
| 2230 return element; | 2230 return element; |
| 2231 } else if (targetType is FunctionType && |
| 2232 _resolver.typeProvider.isObjectMethod(methodName)) { |
| 2233 return _resolver.typeProvider.objectType.element |
| 2234 .getMethod(methodName.name); |
| 2231 } else if (target is SimpleIdentifier) { | 2235 } else if (target is SimpleIdentifier) { |
| 2232 Element targetElement = target.staticElement; | 2236 Element targetElement = target.staticElement; |
| 2233 if (targetType is FunctionType && | 2237 if (targetType is FunctionType && |
| 2234 methodName.name == FunctionElement.CALL_METHOD_NAME) { | 2238 methodName.name == FunctionElement.CALL_METHOD_NAME) { |
| 2235 return targetElement; | 2239 return targetElement; |
| 2236 } | 2240 } |
| 2237 if (targetElement is PrefixElement) { | 2241 if (targetElement is PrefixElement) { |
| 2238 if (isConditional) { | 2242 if (isConditional) { |
| 2239 _resolver.errorReporter.reportErrorForNode( | 2243 _resolver.errorReporter.reportErrorForNode( |
| 2240 CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, | 2244 CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 | 2634 |
| 2631 @override | 2635 @override |
| 2632 Element get staticElement => null; | 2636 Element get staticElement => null; |
| 2633 | 2637 |
| 2634 @override | 2638 @override |
| 2635 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null; | 2639 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null; |
| 2636 | 2640 |
| 2637 @override | 2641 @override |
| 2638 void visitChildren(AstVisitor visitor) {} | 2642 void visitChildren(AstVisitor visitor) {} |
| 2639 } | 2643 } |
| OLD | NEW |