OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 /** | 5 /** |
6 * This library is capable of producing linked summaries from unlinked | 6 * This library is capable of producing linked summaries from unlinked |
7 * ones (or prelinked ones). It functions by building a miniature | 7 * ones (or prelinked ones). It functions by building a miniature |
8 * element model to represent the contents of the summaries, and then | 8 * element model to represent the contents of the summaries, and then |
9 * scanning the element model to gather linked information and adding | 9 * scanning the element model to gather linked information and adding |
10 * it to the summary data structures. | 10 * it to the summary data structures. |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 */ | 1534 */ |
1535 final ParameterElementForLink parameterElement; | 1535 final ParameterElementForLink parameterElement; |
1536 | 1536 |
1537 ConstParameterNode(this.parameterElement); | 1537 ConstParameterNode(this.parameterElement); |
1538 | 1538 |
1539 @override | 1539 @override |
1540 List<ConstNode> computeDependencies() { | 1540 List<ConstNode> computeDependencies() { |
1541 List<ConstNode> dependencies = <ConstNode>[]; | 1541 List<ConstNode> dependencies = <ConstNode>[]; |
1542 collectDependencies( | 1542 collectDependencies( |
1543 dependencies, | 1543 dependencies, |
1544 parameterElement._unlinkedParam.defaultValue, | 1544 parameterElement._unlinkedParam.initializer?.bodyExpr, |
1545 parameterElement.compilationUnit); | 1545 parameterElement.compilationUnit); |
1546 return dependencies; | 1546 return dependencies; |
1547 } | 1547 } |
1548 } | 1548 } |
1549 | 1549 |
1550 /** | 1550 /** |
1551 * Element representing a constructor resynthesized from a summary | 1551 * Element representing a constructor resynthesized from a summary |
1552 * during linking. | 1552 * during linking. |
1553 */ | 1553 */ |
1554 class ConstructorElementForLink extends ExecutableElementForLink_NonLocal | 1554 class ConstructorElementForLink extends ExecutableElementForLink_NonLocal |
(...skipping 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3681 final int _parameterIndex; | 3681 final int _parameterIndex; |
3682 | 3682 |
3683 @override | 3683 @override |
3684 final ParameterParentElementForLink enclosingElement; | 3684 final ParameterParentElementForLink enclosingElement; |
3685 | 3685 |
3686 DartType _inferredType; | 3686 DartType _inferredType; |
3687 DartType _declaredType; | 3687 DartType _declaredType; |
3688 | 3688 |
3689 ParameterElementForLink(this.enclosingElement, this._unlinkedParam, | 3689 ParameterElementForLink(this.enclosingElement, this._unlinkedParam, |
3690 this._typeParameterContext, this.compilationUnit, this._parameterIndex) { | 3690 this._typeParameterContext, this.compilationUnit, this._parameterIndex) { |
3691 if (_unlinkedParam.defaultValue != null) { | 3691 if (_unlinkedParam.initializer?.bodyExpr != null) { |
3692 _constNode = new ConstParameterNode(this); | 3692 _constNode = new ConstParameterNode(this); |
3693 } | 3693 } |
3694 } | 3694 } |
3695 | 3695 |
3696 @override | 3696 @override |
3697 String get displayName => _unlinkedParam.name; | 3697 String get displayName => _unlinkedParam.name; |
3698 | 3698 |
3699 @override | 3699 @override |
3700 bool get hasImplicitType => | 3700 bool get hasImplicitType => |
3701 !_unlinkedParam.isFunctionTyped && _unlinkedParam.type == null; | 3701 !_unlinkedParam.isFunctionTyped && _unlinkedParam.type == null; |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4712 * there are no type parameters in scope. | 4712 * there are no type parameters in scope. |
4713 */ | 4713 */ |
4714 TypeParameterizedElementMixin get _typeParameterContext; | 4714 TypeParameterizedElementMixin get _typeParameterContext; |
4715 | 4715 |
4716 @override | 4716 @override |
4717 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 4717 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
4718 | 4718 |
4719 @override | 4719 @override |
4720 String toString() => '$enclosingElement.$name'; | 4720 String toString() => '$enclosingElement.$name'; |
4721 } | 4721 } |
OLD | NEW |