Skip to content

Commit 9bccc09

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove LocalVariableElement/Fragment.hasInitializer
This property is not useful, and was replaced by `isDefinitelyAssigned` dynamic property. Was deprecated in https://dart-review.googlesource.com/c/sdk/+/439022 Change-Id: I39798b51574e94659bff2920cdfc8b9468af5349 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438601 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 35e6ed4 commit 9bccc09

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

pkg/analyzer/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Remove `ElementLocation` class; its values are not returned anymore.
77
* Remove deprecated `AnalysisContext.analysisOptions`.
88
* Remove deprecated `PromotableElement` and `PromotableFragment`.
9+
* Remove deprecated `LocalVariableElement.hasInitializer`.
10+
* Remove deprecated `LocalVariableFragment.hasInitializer`.
911
* `LibraryFragment` is not `Annotatable` anymore.
1012
* Stop implementing `ConstantEvaluationTarget` by `ElementAnnotation`.
1113
This is an internal interface that should not have been exposed.

pkg/analyzer/api.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3892,11 +3892,9 @@ package:analyzer/dart/element/element.dart:
38923892
baseElement (getter: LocalVariableElement)
38933893
firstFragment (getter: LocalVariableFragment)
38943894
fragments (getter: List<LocalVariableFragment>)
3895-
hasInitializer (getter: bool)
38963895
LocalVariableFragment (class extends Object implements VariableFragment, LocalFragment):
38973896
new (constructor: LocalVariableFragment Function())
38983897
element (getter: LocalVariableElement)
3899-
hasInitializer (getter: bool)
39003898
nameOffset (getter: int)
39013899
nextFragment (getter: LocalVariableFragment?)
39023900
previousFragment (getter: LocalVariableFragment?)

pkg/analyzer/lib/dart/element/element.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,9 +2779,6 @@ abstract class LocalVariableElement
27792779

27802780
@override
27812781
List<LocalVariableFragment> get fragments;
2782-
2783-
/// Whether the variable has an initializer at declaration.
2784-
bool get hasInitializer;
27852782
}
27862783

27872784
/// The portion of a [LocalVariableElement] contributed by a single
@@ -2793,9 +2790,6 @@ abstract class LocalVariableFragment
27932790
@override
27942791
LocalVariableElement get element;
27952792

2796-
/// Whether the variable has an initializer at declaration.
2797-
bool get hasInitializer;
2798-
27992793
/// The offset of the name in this element.
28002794
int get nameOffset;
28012795

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6835,9 +6835,6 @@ class LocalVariableElementImpl extends PromotableElementImpl
68356835
@override
68366836
bool get hasImplicitType => _wrappedElement.hasImplicitType;
68376837

6838-
@override
6839-
bool get hasInitializer => _wrappedElement.hasInitializer;
6840-
68416838
@override
68426839
bool get isConst => _wrappedElement.isConst;
68436840

@@ -6914,9 +6911,6 @@ class LocalVariableFragmentImpl extends NonParameterVariableFragmentImpl
69146911
@override
69156912
MetadataImpl metadata = MetadataImpl(const []);
69166913

6917-
@override
6918-
late bool hasInitializer;
6919-
69206914
/// Initialize a newly created method element to have the given [name] and
69216915
/// [offset].
69226916
LocalVariableFragmentImpl({required this.name2, required super.nameOffset});

0 commit comments

Comments
 (0)