@@ -3280,9 +3280,6 @@ class FormalParameterFragmentImpl extends VariableFragmentImpl
3280
3280
/// Whether the parameter is an initializing formal parameter.
3281
3281
bool get isInitializingFormal => false ;
3282
3282
3283
- @override
3284
- bool get isLate => false ;
3285
-
3286
3283
/// Whether the parameter is a named parameter.
3287
3284
///
3288
3285
/// Named parameters that are annotated with the `@required` annotation are
@@ -6991,7 +6988,7 @@ class LocalVariableElementImpl extends PromotableElementImpl
6991
6988
}
6992
6989
6993
6990
class LocalVariableFragmentImpl extends NonParameterVariableFragmentImpl
6994
- implements LocalVariableFragment , VariableElementOrMember {
6991
+ implements LocalVariableFragment {
6995
6992
late LocalVariableElementImpl _element2 = switch (this ) {
6996
6993
BindPatternVariableFragmentImpl () => BindPatternVariableElementImpl (this ),
6997
6994
JoinPatternVariableFragmentImpl () => JoinPatternVariableElementImpl (this ),
@@ -7025,11 +7022,6 @@ class LocalVariableFragmentImpl extends NonParameterVariableFragmentImpl
7025
7022
enclosingElement3 = value as FragmentImpl ;
7026
7023
}
7027
7024
7028
- @override
7029
- bool get isLate {
7030
- return hasModifier (Modifier .LATE );
7031
- }
7032
-
7033
7025
@override
7034
7026
ElementKind get kind => ElementKind .LOCAL_VARIABLE ;
7035
7027
@@ -8725,11 +8717,6 @@ abstract class PropertyInducingFragmentImpl
8725
8717
return ! isFinal;
8726
8718
}
8727
8719
8728
- @override
8729
- bool get isLate {
8730
- return hasModifier (Modifier .LATE );
8731
- }
8732
-
8733
8720
@override
8734
8721
LibraryFragment get libraryFragment {
8735
8722
return enclosingFragment.libraryFragment! ;
@@ -10159,52 +10146,8 @@ abstract class VariableElementImpl extends ElementImpl
10159
10146
}
10160
10147
}
10161
10148
10162
- /// Common base class for all analyzer-internal classes that implement
10163
- /// `VariableElement` .
10164
- abstract class VariableElementOrMember
10165
- implements FragmentOrMember , Annotatable {
10166
- @override
10167
- VariableFragmentImpl get declaration;
10168
-
10169
- /// Whether the variable element did not have an explicit type specified
10170
- /// for it.
10171
- bool get hasImplicitType;
10172
-
10173
- /// Whether the variable was declared with the 'const' modifier.
10174
- bool get isConst;
10175
-
10176
- /// Whether the variable was declared with the 'final' modifier.
10177
- ///
10178
- /// Variables that are declared with the 'const' modifier will return `false`
10179
- /// even though they are implicitly final.
10180
- bool get isFinal;
10181
-
10182
- /// Whether the variable uses late evaluation semantics.
10183
- ///
10184
- /// This will always return `false` unless the experiment 'non-nullable' is
10185
- /// enabled.
10186
- bool get isLate;
10187
-
10188
- /// Whether the element is a static variable, as per section 8 of the Dart
10189
- /// Language Specification:
10190
- ///
10191
- /// > A static variable is a variable that is not associated with a particular
10192
- /// > instance, but rather with an entire library or class. Static variables
10193
- /// > include library variables and class variables. Class variables are
10194
- /// > variables whose declaration is immediately nested inside a class
10195
- /// > declaration and includes the modifier static. A library variable is
10196
- /// > implicitly static.
10197
- bool get isStatic;
10198
-
10199
- /// The declared type of this variable.
10200
- TypeImpl get type;
10201
- }
10202
-
10203
10149
abstract class VariableFragmentImpl extends FragmentImpl
10204
- implements
10205
- VariableElementOrMember ,
10206
- AnnotatableFragmentImpl ,
10207
- VariableFragment {
10150
+ implements AnnotatableFragmentImpl , VariableFragment {
10208
10151
/// The type of this variable.
10209
10152
TypeImpl ? _type;
10210
10153
@@ -10230,7 +10173,8 @@ abstract class VariableFragmentImpl extends FragmentImpl
10230
10173
@override
10231
10174
VariableElementImpl get element;
10232
10175
10233
- @override
10176
+ /// Whether the variable element did not have an explicit type specified
10177
+ /// for it.
10234
10178
bool get hasImplicitType {
10235
10179
return hasModifier (Modifier .IMPLICIT_TYPE );
10236
10180
}
@@ -10250,7 +10194,7 @@ abstract class VariableFragmentImpl extends FragmentImpl
10250
10194
setModifier (Modifier .ABSTRACT , isAbstract);
10251
10195
}
10252
10196
10253
- @override
10197
+ /// Whether the variable was declared with the 'const' modifier.
10254
10198
bool get isConst {
10255
10199
return hasModifier (Modifier .CONST );
10256
10200
}
@@ -10265,7 +10209,10 @@ abstract class VariableFragmentImpl extends FragmentImpl
10265
10209
setModifier (Modifier .EXTERNAL , isExternal);
10266
10210
}
10267
10211
10268
- @override
10212
+ /// Whether the variable was declared with the 'final' modifier.
10213
+ ///
10214
+ /// Variables that are declared with the 'const' modifier will return `false`
10215
+ /// even though they are implicitly final.
10269
10216
bool get isFinal {
10270
10217
return hasModifier (Modifier .FINAL );
10271
10218
}
@@ -10275,12 +10222,28 @@ abstract class VariableFragmentImpl extends FragmentImpl
10275
10222
setModifier (Modifier .FINAL , isFinal);
10276
10223
}
10277
10224
10225
+ /// Whether the variable uses late evaluation semantics.
10226
+ ///
10227
+ /// This will always return `false` unless the experiment 'non-nullable' is
10228
+ /// enabled.
10229
+ bool get isLate {
10230
+ return hasModifier (Modifier .LATE );
10231
+ }
10232
+
10278
10233
/// Set whether this variable is late.
10279
10234
set isLate (bool isLate) {
10280
10235
setModifier (Modifier .LATE , isLate);
10281
10236
}
10282
10237
10283
- @override
10238
+ /// Whether the element is a static variable, as per section 8 of the Dart
10239
+ /// Language Specification:
10240
+ ///
10241
+ /// > A static variable is a variable that is not associated with a particular
10242
+ /// > instance, but rather with an entire library or class. Static variables
10243
+ /// > include library variables and class variables. Class variables are
10244
+ /// > variables whose declaration is immediately nested inside a class
10245
+ /// > declaration and includes the modifier static. A library variable is
10246
+ /// > implicitly static.
10284
10247
bool get isStatic => hasModifier (Modifier .STATIC );
10285
10248
10286
10249
set isStatic (bool isStatic) {
@@ -10290,7 +10253,8 @@ abstract class VariableFragmentImpl extends FragmentImpl
10290
10253
@override
10291
10254
int get offset => nameOffset;
10292
10255
10293
- @override
10256
+ /// The declared type of this variable.
10257
+ // TODO(scheglov): make it nullable and turn into field
10294
10258
TypeImpl get type => _type! ;
10295
10259
10296
10260
set type (TypeImpl type) {
0 commit comments