Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: pkg/analyzer/lib/src/generated/element_resolver.dart

Issue 2187863003: Always set correspondingStaticParameters and correspondingPropagatedParameters, to clear when we don (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/ast.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/ast.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698