Skip to content

Commit adad55f

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove V1 PropertyAccessorElement.
Change-Id: Ife5ded38f5c4bb3951653013d7d283c663a4f300 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423208 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent c6e3f9a commit adad55f

File tree

4 files changed

+37
-118
lines changed

4 files changed

+37
-118
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,7 +2976,6 @@ package:analyzer/dart/element/element.dart:
29762976
isStatic (getter: bool)
29772977
CompilationUnitElement (class extends Object implements UriReferencedElement, deprecated):
29782978
new (constructor: CompilationUnitElement Function())
2979-
accessors (getter: List<PropertyAccessorElement>)
29802979
enclosingElement3 (getter: CompilationUnitElement?)
29812980
libraryExports (getter: List<LibraryExportElement>)
29822981
libraryImportPrefixes (getter: List<PrefixElement>)
@@ -3280,24 +3279,13 @@ package:analyzer/dart/element/element.dart:
32803279
PromotableElement (class extends Object implements LocalElement, VariableElement, deprecated):
32813280
new (constructor: PromotableElement Function())
32823281
name (getter: String)
3283-
PropertyAccessorElement (class extends Object implements ExecutableElement, deprecated):
3284-
new (constructor: PropertyAccessorElement Function())
3285-
correspondingGetter (getter: PropertyAccessorElement?)
3286-
correspondingSetter (getter: PropertyAccessorElement?)
3287-
declaration (getter: PropertyAccessorElement)
3288-
enclosingElement3 (getter: Element)
3289-
isGetter (getter: bool)
3290-
isSetter (getter: bool)
3291-
variable2 (getter: PropertyInducingElement?)
32923282
PropertyInducingElement (class extends Object implements VariableElement, deprecated):
32933283
new (constructor: PropertyInducingElement Function())
32943284
displayName (getter: String)
3295-
getter (getter: PropertyAccessorElement?, deprecated)
32963285
hasInitializer (getter: bool)
32973286
isAugmentation (getter: bool)
32983287
library (getter: LibraryElement)
32993288
name (getter: String)
3300-
setter (getter: PropertyAccessorElement?, deprecated)
33013289
ShowElementCombinator (class extends Object implements NamespaceCombinator):
33023290
new (constructor: ShowElementCombinator Function())
33033291
shownNames (getter: List<String>)

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

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ abstract class ClassMemberElement implements Element {
9696
/// Clients may not extend, implement or mix-in this class.
9797
@Deprecated(elementModelDeprecationMsg)
9898
abstract class CompilationUnitElement implements UriReferencedElement {
99-
/// The top-level accessors (getters and setters) declared in this
100-
/// compilation unit.
101-
List<PropertyAccessorElement> get accessors;
102-
10399
/// The [CompilationUnitElement] that uses `part` directive to include this
104100
/// element, or `null` if this element is the defining unit of the library.
105101
@override
@@ -1321,53 +1317,6 @@ abstract class PromotableElement implements LocalElement, VariableElement {
13211317
String get name;
13221318
}
13231319

1324-
/// A getter or a setter. Note that explicitly defined property accessors
1325-
/// implicitly define a synthetic field. Symmetrically, synthetic accessors are
1326-
/// implicitly created for explicitly defined fields. The following rules apply:
1327-
///
1328-
/// * Every explicit field is represented by a non-synthetic [FieldElement].
1329-
/// * Every explicit field induces a getter and possibly a setter, both of which
1330-
/// are represented by synthetic [PropertyAccessorElement]s.
1331-
/// * Every explicit getter or setter is represented by a non-synthetic
1332-
/// [PropertyAccessorElement].
1333-
/// * Every explicit getter or setter (or pair thereof if they have the same
1334-
/// name) induces a field that is represented by a synthetic [FieldElement].
1335-
///
1336-
/// Clients may not extend, implement or mix-in this class.
1337-
@Deprecated('Use PropertyAccessorElement2 instead')
1338-
abstract class PropertyAccessorElement implements ExecutableElement {
1339-
/// The accessor representing the getter that corresponds to (has the same
1340-
/// name as) this setter, or `null` if this accessor is not a setter or
1341-
/// if there is no corresponding getter.
1342-
PropertyAccessorElement? get correspondingGetter;
1343-
1344-
/// The accessor representing the setter that corresponds to (has the same
1345-
/// name as) this getter, or `null` if this accessor is not a getter or
1346-
/// if there is no corresponding setter.
1347-
PropertyAccessorElement? get correspondingSetter;
1348-
1349-
@override
1350-
PropertyAccessorElement get declaration;
1351-
1352-
@override
1353-
Element get enclosingElement3;
1354-
1355-
/// Whether the accessor represents a getter.
1356-
bool get isGetter;
1357-
1358-
/// Whether the accessor represents a setter.
1359-
bool get isSetter;
1360-
1361-
/// The field or top-level variable associated with this accessor.
1362-
///
1363-
/// If this accessor was explicitly defined (is not synthetic) then the
1364-
/// variable associated with it will be synthetic.
1365-
///
1366-
/// If this accessor is an augmentation, and [augmentationTarget] is `null`,
1367-
/// the variable is `null`.
1368-
PropertyInducingElement? get variable2;
1369-
}
1370-
13711320
/// A variable that has an associated getter and possibly a setter. Note that
13721321
/// explicitly defined variables implicitly define a synthetic getter and that
13731322
/// non-`final` explicitly defined variables implicitly define a synthetic
@@ -1390,13 +1339,6 @@ abstract class PropertyInducingElement implements VariableElement {
13901339
@override
13911340
String get displayName;
13921341

1393-
/// The getter associated with this variable.
1394-
///
1395-
/// If this variable was explicitly defined (is not synthetic) then the
1396-
/// getter associated with it will be synthetic.
1397-
@Deprecated(elementModelDeprecationMsg)
1398-
PropertyAccessorElement? get getter;
1399-
14001342
/// Whether the variable has an initializer at declaration.
14011343
bool get hasInitializer;
14021344

@@ -1410,18 +1352,6 @@ abstract class PropertyInducingElement implements VariableElement {
14101352

14111353
@override
14121354
String get name;
1413-
1414-
/// The setter associated with this variable, or `null` if the variable
1415-
/// is effectively `final` and therefore does not have a setter associated
1416-
/// with it.
1417-
///
1418-
/// This can happen either because the variable is explicitly defined as
1419-
/// being `final` or because the variable is induced by an explicit getter
1420-
/// that does not have a corresponding setter. If this variable was
1421-
/// explicitly defined (is not synthetic) then the setter associated with
1422-
/// it will be synthetic.
1423-
@Deprecated(elementModelDeprecationMsg)
1424-
PropertyAccessorElement? get setter;
14251355
}
14261356

14271357
/// A combinator that cause some of the names in a namespace to be visible (and

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

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,6 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl
768768
return scope.accessibleExtensions;
769769
}
770770

771-
@override
772771
List<PropertyAccessorElementImpl> get accessors {
773772
return _accessors;
774773
}
@@ -9407,14 +9406,33 @@ class PropertyAccessorElementImpl_ImplicitSetter extends SetterFragmentImpl {
94079406
/// Common base class for all analyzer-internal classes that implement
94089407
/// `PropertyAccessorElement`.
94099408
abstract class PropertyAccessorElementOrMember
9410-
implements
9411-
// ignore:deprecated_member_use_from_same_package,analyzer_use_new_elements
9412-
PropertyAccessorElement,
9413-
ExecutableElementOrMember {
9409+
implements ExecutableElementOrMember {
9410+
/// The accessor representing the getter that corresponds to (has the same
9411+
/// name as) this setter, or `null` if this accessor is not a setter or
9412+
/// if there is no corresponding getter.
9413+
PropertyAccessorElementOrMember? get correspondingGetter;
9414+
9415+
/// The accessor representing the setter that corresponds to (has the same
9416+
/// name as) this getter, or `null` if this accessor is not a getter or
9417+
/// if there is no corresponding setter.
9418+
PropertyAccessorElementOrMember? get correspondingSetter;
9419+
9420+
/// Whether the accessor represents a getter.
9421+
bool get isGetter;
9422+
9423+
/// Whether the accessor represents a setter.
9424+
bool get isSetter;
9425+
94149426
@override
94159427
TypeImpl get returnType;
94169428

9417-
@override
9429+
/// The field or top-level variable associated with this accessor.
9430+
///
9431+
/// If this accessor was explicitly defined (is not synthetic) then the
9432+
/// variable associated with it will be synthetic.
9433+
///
9434+
/// If this accessor is an augmentation, and [augmentationTarget] is `null`,
9435+
/// the variable is `null`.
94189436
PropertyInducingElementOrMember? get variable2;
94199437
}
94209438

@@ -9448,14 +9466,21 @@ abstract class PropertyInducingElementImpl
94489466
@override
94499467
PropertyInducingElementImpl? nextFragment;
94509468

9451-
/// The getter associated with this element.
9452-
@override
9469+
/// The getter associated with this variable.
9470+
///
9471+
/// If this variable was explicitly defined (is not synthetic) then the
9472+
/// getter associated with it will be synthetic.
94539473
GetterFragmentImpl? getter;
94549474

9455-
/// The setter associated with this element, or `null` if the element is
9456-
/// effectively `final` and therefore does not have a setter associated with
9457-
/// it.
9458-
@override
9475+
/// The setter associated with this variable, or `null` if the variable
9476+
/// is effectively `final` and therefore does not have a setter associated
9477+
/// with it.
9478+
///
9479+
/// This can happen either because the variable is explicitly defined as
9480+
/// being `final` or because the variable is induced by an explicit getter
9481+
/// that does not have a corresponding setter. If this variable was
9482+
/// explicitly defined (is not synthetic) then the setter associated with
9483+
/// it will be synthetic.
94599484
SetterFragmentImpl? setter;
94609485

94619486
/// This field is set during linking, and performs type inference for

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -522,18 +522,6 @@ class FieldMember extends VariableMember
522522
];
523523
}
524524

525-
@override
526-
PropertyAccessorElementOrMember? get getter {
527-
var baseGetter = declaration.getter;
528-
if (baseGetter == null) {
529-
return null;
530-
}
531-
return PropertyAccessorMember(
532-
declaration: baseGetter,
533-
substitution: substitution,
534-
);
535-
}
536-
537525
@override
538526
GetterElement2OrMember? get getter2 {
539527
var baseGetter = declaration.getter;
@@ -587,18 +575,6 @@ class FieldMember extends VariableMember
587575
@override
588576
Element2 get nonSynthetic2 => _element2.nonSynthetic2;
589577

590-
@override
591-
PropertyAccessorElementOrMember? get setter {
592-
var baseSetter = declaration.setter;
593-
if (baseSetter == null) {
594-
return null;
595-
}
596-
return PropertyAccessorMember(
597-
declaration: baseSetter,
598-
substitution: substitution,
599-
);
600-
}
601-
602578
@override
603579
SetterElement2OrMember? get setter2 {
604580
var baseSetter = declaration.setter;

0 commit comments

Comments
 (0)