| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 _computeMethodInvokeType(node, propagatedElement); | 646 _computeMethodInvokeType(node, propagatedElement); |
| 647 | 647 |
| 648 // | 648 // |
| 649 // Record the results. | 649 // Record the results. |
| 650 // | 650 // |
| 651 methodName.staticElement = staticElement; | 651 methodName.staticElement = staticElement; |
| 652 methodName.propagatedElement = propagatedElement; | 652 methodName.propagatedElement = propagatedElement; |
| 653 | 653 |
| 654 node.staticInvokeType = staticInvokeType; | 654 node.staticInvokeType = staticInvokeType; |
| 655 if (propagatedInvokeType != null && | 655 if (propagatedInvokeType != null && |
| 656 propagatedInvokeType.isMoreSpecificThan(staticInvokeType)) { | 656 (staticInvokeType == null || |
| 657 propagatedInvokeType.isMoreSpecificThan(staticInvokeType))) { |
| 657 // Don't store the propagated invoke type unless it's more specific than | 658 // Don't store the propagated invoke type unless it's more specific than |
| 658 // the static type. We still need to record the propagated parameter | 659 // the static type. We still need to record the propagated parameter |
| 659 // elements however, as that is used for the propagatedType downwards | 660 // elements however, as that is used for the propagatedType downwards |
| 660 // inference of lambda parameters. | 661 // inference of lambda parameters. |
| 661 node.propagatedInvokeType = propagatedInvokeType; | 662 node.propagatedInvokeType = propagatedInvokeType; |
| 662 } else { | 663 } else { |
| 663 node.propagatedInvokeType = null; | 664 node.propagatedInvokeType = null; |
| 664 } | 665 } |
| 665 | 666 |
| 666 ArgumentList argumentList = node.argumentList; | 667 ArgumentList argumentList = node.argumentList; |
| (...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2569 | 2570 |
| 2570 @override | 2571 @override |
| 2571 Element get staticElement => null; | 2572 Element get staticElement => null; |
| 2572 | 2573 |
| 2573 @override | 2574 @override |
| 2574 accept(AstVisitor visitor) => null; | 2575 accept(AstVisitor visitor) => null; |
| 2575 | 2576 |
| 2576 @override | 2577 @override |
| 2577 void visitChildren(AstVisitor visitor) {} | 2578 void visitChildren(AstVisitor visitor) {} |
| 2578 } | 2579 } |
| OLD | NEW |