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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 // as they are used in propagatedType downwards inference of lambda | 691 // as they are used in propagatedType downwards inference of lambda |
692 // parameters. So we don't want to clear the propagatedInvokeType variable. | 692 // parameters. So we don't want to clear the propagatedInvokeType variable. |
693 // | 693 // |
694 node.propagatedInvokeType = | 694 node.propagatedInvokeType = |
695 _propagatedInvokeTypeIfBetter(propagatedInvokeType, staticInvokeType); | 695 _propagatedInvokeTypeIfBetter(propagatedInvokeType, staticInvokeType); |
696 | 696 |
697 ArgumentList argumentList = node.argumentList; | 697 ArgumentList argumentList = node.argumentList; |
698 if (staticInvokeType != null) { | 698 if (staticInvokeType != null) { |
699 List<ParameterElement> parameters = | 699 List<ParameterElement> parameters = |
700 _computeCorrespondingParameters(argumentList, staticInvokeType); | 700 _computeCorrespondingParameters(argumentList, staticInvokeType); |
701 if (parameters != null) { | 701 argumentList.correspondingStaticParameters = parameters; |
702 argumentList.correspondingStaticParameters = parameters; | |
703 } | |
704 } | 702 } |
705 if (propagatedInvokeType != null) { | 703 if (propagatedInvokeType != null) { |
706 List<ParameterElement> parameters = | 704 List<ParameterElement> parameters = |
707 _computeCorrespondingParameters(argumentList, propagatedInvokeType); | 705 _computeCorrespondingParameters(argumentList, propagatedInvokeType); |
708 if (parameters != null) { | 706 argumentList.correspondingPropagatedParameters = parameters; |
709 argumentList.correspondingPropagatedParameters = parameters; | |
710 } | |
711 } | 707 } |
712 // | 708 // |
713 // Then check for error conditions. | 709 // Then check for error conditions. |
714 // | 710 // |
715 ErrorCode errorCode = _checkForInvocationError(target, true, staticElement); | 711 ErrorCode errorCode = _checkForInvocationError(target, true, staticElement); |
716 bool generatedWithTypePropagation = false; | 712 bool generatedWithTypePropagation = false; |
717 if (_enableHints && errorCode == null && staticElement == null) { | 713 if (_enableHints && errorCode == null && staticElement == null) { |
718 // The method lookup may have failed because there were multiple | 714 // The method lookup may have failed because there were multiple |
719 // incompatible choices. In this case we don't want to generate a hint. | 715 // incompatible choices. In this case we don't want to generate a hint. |
720 errorCode = _checkForInvocationError(target, false, propagatedElement); | 716 errorCode = _checkForInvocationError(target, false, propagatedElement); |
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 | 2590 |
2595 @override | 2591 @override |
2596 Element get staticElement => null; | 2592 Element get staticElement => null; |
2597 | 2593 |
2598 @override | 2594 @override |
2599 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null; | 2595 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null; |
2600 | 2596 |
2601 @override | 2597 @override |
2602 void visitChildren(AstVisitor visitor) {} | 2598 void visitChildren(AstVisitor visitor) {} |
2603 } | 2599 } |
OLD | NEW |