@@ -3040,33 +3040,11 @@ abstract class ExecutableElementImpl extends _ExistingElementImpl
3040
3040
ExecutableElementImpl (String name, int offset, {Reference ? reference})
3041
3041
: super (name, offset, reference: reference);
3042
3042
3043
- /// Initialize using the given linked node.
3044
- ExecutableElementImpl .forLinkedNode (
3045
- ElementImpl enclosing, Reference reference, AstNode ? linkedNode)
3046
- : super .forLinkedNode (enclosing, reference, linkedNode) {
3047
- if (linkedNode is MethodDeclarationImpl ) {
3048
- linkedNode.name.staticElement = this ;
3049
- } else if (linkedNode is FunctionDeclarationImpl ) {
3050
- linkedNode.name.staticElement = this ;
3051
- }
3052
- }
3053
-
3054
- @override
3055
- String get displayName {
3056
- if (linkedNode != null ) {
3057
- return reference! .name;
3058
- }
3059
- return super .displayName;
3060
- }
3061
-
3062
3043
@override
3063
3044
Element get enclosingElement => super .enclosingElement! ;
3064
3045
3065
3046
@override
3066
3047
bool get hasImplicitReturnType {
3067
- if (linkedNode != null ) {
3068
- return linkedContext! .hasImplicitReturnType (linkedNode! );
3069
- }
3070
3048
return hasModifier (Modifier .IMPLICIT_TYPE );
3071
3049
}
3072
3050
@@ -3077,18 +3055,11 @@ abstract class ExecutableElementImpl extends _ExistingElementImpl
3077
3055
3078
3056
@override
3079
3057
bool get isAbstract {
3080
- if (linkedNode != null ) {
3081
- return ! isExternal &&
3082
- enclosingUnit.linkedContext! .isAbstract (linkedNode! );
3083
- }
3084
3058
return hasModifier (Modifier .ABSTRACT );
3085
3059
}
3086
3060
3087
3061
@override
3088
3062
bool get isAsynchronous {
3089
- if (linkedNode != null ) {
3090
- return enclosingUnit.linkedContext! .isAsynchronous (linkedNode! );
3091
- }
3092
3063
return hasModifier (Modifier .ASYNCHRONOUS );
3093
3064
}
3094
3065
@@ -3099,9 +3070,6 @@ abstract class ExecutableElementImpl extends _ExistingElementImpl
3099
3070
3100
3071
@override
3101
3072
bool get isExternal {
3102
- if (linkedNode != null ) {
3103
- return enclosingUnit.linkedContext! .isExternal (linkedNode! );
3104
- }
3105
3073
return hasModifier (Modifier .EXTERNAL );
3106
3074
}
3107
3075
@@ -3112,9 +3080,6 @@ abstract class ExecutableElementImpl extends _ExistingElementImpl
3112
3080
3113
3081
@override
3114
3082
bool get isGenerator {
3115
- if (linkedNode != null ) {
3116
- return enclosingUnit.linkedContext! .isGenerator (linkedNode! );
3117
- }
3118
3083
return hasModifier (Modifier .GENERATOR );
3119
3084
}
3120
3085
@@ -3137,21 +3102,9 @@ abstract class ExecutableElementImpl extends _ExistingElementImpl
3137
3102
3138
3103
@override
3139
3104
String get name {
3140
- if (linkedNode != null ) {
3141
- return reference! .name;
3142
- }
3143
3105
return super .name! ;
3144
3106
}
3145
3107
3146
- @override
3147
- int get nameOffset {
3148
- if (linkedNode != null ) {
3149
- return enclosingUnit.linkedContext! .getNameOffset (linkedNode! );
3150
- }
3151
-
3152
- return super .nameOffset;
3153
- }
3154
-
3155
3108
@override
3156
3109
List <ParameterElement > get parameters =>
3157
3110
ElementTypeProvider .current.getExecutableParameters (this );
@@ -3175,22 +3128,6 @@ abstract class ExecutableElementImpl extends _ExistingElementImpl
3175
3128
/// In most cases, the [parameters] getter should be used instead.
3176
3129
List <ParameterElement > get parametersInternal {
3177
3130
linkedData? .read (this );
3178
- if (! identical (_parameters, _Sentinel .parameterElement)) {
3179
- return _parameters;
3180
- }
3181
-
3182
- if (linkedNode != null ) {
3183
- var context = enclosingUnit.linkedContext! ;
3184
- var containerRef = reference! .getChild ('@parameter' );
3185
- var formalParameters = context.getFormalParameters (linkedNode! );
3186
- _parameters = ParameterElementImpl .forLinkedNodeList (
3187
- this ,
3188
- context,
3189
- containerRef,
3190
- formalParameters,
3191
- );
3192
- }
3193
-
3194
3131
return _parameters;
3195
3132
}
3196
3133
@@ -5133,58 +5070,17 @@ abstract class NonParameterVariableElementImpl extends VariableElementImpl
5133
5070
NonParameterVariableElementImpl (String name, int offset)
5134
5071
: super (name, offset);
5135
5072
5136
- NonParameterVariableElementImpl .forLinkedNode (
5137
- ElementImpl enclosing, Reference reference, AstNode linkedNode)
5138
- : super .forLinkedNode (enclosing, reference, linkedNode);
5139
-
5140
5073
@override
5141
5074
Element get enclosingElement => super .enclosingElement! ;
5142
5075
5143
- @override
5144
- bool get hasImplicitType {
5145
- if (linkedNode != null ) {
5146
- return linkedContext! .hasImplicitType (linkedNode! );
5147
- }
5148
- return super .hasImplicitType;
5149
- }
5150
-
5151
5076
bool get hasInitializer {
5152
- if (linkedNode != null ) {
5153
- return linkedContext!
5154
- .hasInitializer (linkedNode as VariableDeclarationImpl );
5155
- }
5156
5077
return hasModifier (Modifier .HAS_INITIALIZER );
5157
5078
}
5158
5079
5159
5080
/// Set whether this variable has an initializer.
5160
5081
set hasInitializer (bool hasInitializer) {
5161
5082
setModifier (Modifier .HAS_INITIALIZER , hasInitializer);
5162
5083
}
5163
-
5164
- @override
5165
- String get name {
5166
- if (linkedNode != null ) {
5167
- return reference! .name;
5168
- }
5169
- return super .name;
5170
- }
5171
-
5172
- @override
5173
- int get nameOffset {
5174
- if (linkedNode != null ) {
5175
- return enclosingUnit.linkedContext! .getNameOffset (linkedNode! );
5176
- }
5177
-
5178
- return super .nameOffset;
5179
- }
5180
-
5181
- @override
5182
- DartType get type => ElementTypeProvider .current.getVariableType (this );
5183
-
5184
- @override
5185
- set type (DartType type) {
5186
- _type = type;
5187
- }
5188
5084
}
5189
5085
5190
5086
/// A concrete implementation of a [ParameterElement] .
@@ -5910,10 +5806,6 @@ abstract class PropertyInducingElementImpl
5910
5806
/// [offset] .
5911
5807
PropertyInducingElementImpl (String name, int offset) : super (name, offset);
5912
5808
5913
- PropertyInducingElementImpl .forLinkedNode (
5914
- ElementImpl enclosing, Reference reference, AstNode linkedNode)
5915
- : super .forLinkedNode (enclosing, reference, linkedNode);
5916
-
5917
5809
bool get hasTypeInferred => hasModifier (Modifier .HAS_TYPE_INFERRED );
5918
5810
5919
5811
set hasTypeInferred (bool value) {
@@ -5925,9 +5817,6 @@ abstract class PropertyInducingElementImpl
5925
5817
5926
5818
@override
5927
5819
bool get isLate {
5928
- if (linkedNode != null ) {
5929
- return enclosingUnit.linkedContext! .isLate (linkedNode! );
5930
- }
5931
5820
return hasModifier (Modifier .LATE );
5932
5821
}
5933
5822
@@ -5939,19 +5828,6 @@ abstract class PropertyInducingElementImpl
5939
5828
linkedData? .read (this );
5940
5829
if (_type != null ) return _type! ;
5941
5830
5942
- if (linkedNode != null ) {
5943
- // While performing inference during linking, the first step is to collect
5944
- // dependencies. During this step we resolve the expression, but we might
5945
- // reference elements that don't have their types inferred yet. So, here
5946
- // we give some type. A better solution would be to infer recursively, but
5947
- // we are not doing this yet.
5948
- if (_type == null ) {
5949
- assert (linkedContext! .isLinking);
5950
- return DynamicTypeImpl .instance;
5951
- }
5952
-
5953
- return _type! ;
5954
- }
5955
5831
if (isSynthetic && _type == null ) {
5956
5832
if (getter != null ) {
5957
5833
_type = getter! .returnType;
0 commit comments