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/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 propagatedElement = null; | 609 propagatedElement = null; |
610 } else if (methodName.name == FunctionElement.LOAD_LIBRARY_NAME && | 610 } else if (methodName.name == FunctionElement.LOAD_LIBRARY_NAME && |
611 _isDeferredPrefix(target)) { | 611 _isDeferredPrefix(target)) { |
612 if (node.operator.type == sc.TokenType.QUESTION_PERIOD) { | 612 if (node.operator.type == sc.TokenType.QUESTION_PERIOD) { |
613 _resolver.reportErrorForNode( | 613 _resolver.reportErrorForNode( |
614 CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, | 614 CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, |
615 target, | 615 target, |
616 [(target as SimpleIdentifier).name]); | 616 [(target as SimpleIdentifier).name]); |
617 } | 617 } |
618 LibraryElement importedLibrary = _getImportedLibrary(target); | 618 LibraryElement importedLibrary = _getImportedLibrary(target); |
619 methodName.staticElement = importedLibrary.loadLibraryFunction; | 619 FunctionElement loadLibraryFunction = importedLibrary.loadLibraryFunction; |
| 620 methodName.staticElement = loadLibraryFunction; |
| 621 node.staticInvokeType = loadLibraryFunction.type; |
620 return null; | 622 return null; |
621 } else { | 623 } else { |
622 // | 624 // |
623 // If this method invocation is of the form 'C.m' where 'C' is a class, | 625 // If this method invocation is of the form 'C.m' where 'C' is a class, |
624 // then we don't call resolveInvokedElement(...) which walks up the class | 626 // then we don't call resolveInvokedElement(...) which walks up the class |
625 // hierarchy, instead we just look for the member in the type only. This | 627 // hierarchy, instead we just look for the member in the type only. This |
626 // does not apply to conditional method invocation (i.e. 'C?.m(...)'). | 628 // does not apply to conditional method invocation (i.e. 'C?.m(...)'). |
627 // | 629 // |
628 bool isConditional = node.operator.type == sc.TokenType.QUESTION_PERIOD; | 630 bool isConditional = node.operator.type == sc.TokenType.QUESTION_PERIOD; |
629 ClassElementImpl typeReference = getTypeReference(target); | 631 ClassElementImpl typeReference = getTypeReference(target); |
(...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2607 | 2609 |
2608 @override | 2610 @override |
2609 Element get staticElement => null; | 2611 Element get staticElement => null; |
2610 | 2612 |
2611 @override | 2613 @override |
2612 accept(AstVisitor visitor) => null; | 2614 accept(AstVisitor visitor) => null; |
2613 | 2615 |
2614 @override | 2616 @override |
2615 void visitChildren(AstVisitor visitor) {} | 2617 void visitChildren(AstVisitor visitor) {} |
2616 } | 2618 } |
OLD | NEW |