Elements. Remove V1 FieldElement.
Change-Id: Ie5b1f35b1922f716c0d1a313f8105dd9a1f90bc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/api.txt b/pkg/analyzer/api.txt
index 74f8399..ecd7f80 100644
--- a/pkg/analyzer/api.txt
+++ b/pkg/analyzer/api.txt
@@ -3160,15 +3160,6 @@
isStatic (getter: bool)
isSynchronous (getter: bool)
name (getter: String)
- FieldElement (class extends Object implements ClassMemberElement, PropertyInducingElement, deprecated):
- new (constructor: FieldElement Function())
- declaration (getter: FieldElement)
- isAbstract (getter: bool)
- isCovariant (getter: bool)
- isEnumConstant (getter: bool)
- isExternal (getter: bool)
- isPromotable (getter: bool)
- isStatic (getter: bool)
FunctionTypedElement (class extends Object implements TypeParameterizedElement, deprecated):
new (constructor: FunctionTypedElement Function())
parameters (getter: List<ParameterElement>)
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 26d0519..703949b 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -862,41 +862,6 @@
String get name;
}
-/// A field defined within a class.
-///
-/// Clients may not extend, implement or mix-in this class.
-@Deprecated('Use FieldElement2 instead')
-abstract class FieldElement
- implements ClassMemberElement, PropertyInducingElement {
- @override
- FieldElement get declaration;
-
- /// Whether the field is abstract.
- ///
- /// Executable fields are abstract if they are declared with the `abstract`
- /// keyword.
- bool get isAbstract;
-
- /// Whether the field was explicitly marked as being covariant.
- bool get isCovariant;
-
- /// Whether the element is an enum constant.
- bool get isEnumConstant;
-
- /// Whether the field was explicitly marked as being external.
- bool get isExternal;
-
- /// Whether the field can be type promoted.
- bool get isPromotable;
-
- /// Whether the element is a static element.
- ///
- /// A static element is an element that is not associated with a particular
- /// instance, but rather with an entire library or class.
- @override
- bool get isStatic;
-}
-
/// An element that has a [FunctionType] as its [type].
///
/// This also provides convenient access to the parameters and return type.
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index b1a23e7..6899541 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -4021,12 +4021,15 @@
set element(FieldElementImpl2 element) => _element = element;
- @override
+ /// Whether the field is abstract.
+ ///
+ /// Executable fields are abstract if they are declared with the `abstract`
+ /// keyword.
bool get isAbstract {
return hasModifier(Modifier.ABSTRACT);
}
- @override
+ /// Whether the field was explicitly marked as being covariant.
bool get isCovariant {
return hasModifier(Modifier.COVARIANT);
}
@@ -4036,7 +4039,7 @@
setModifier(Modifier.COVARIANT, isCovariant);
}
- @override
+ /// Whether the element is an enum constant.
bool get isEnumConstant {
return hasModifier(Modifier.ENUM_CONSTANT);
}
@@ -4045,12 +4048,12 @@
setModifier(Modifier.ENUM_CONSTANT, isEnumConstant);
}
- @override
+ /// Whether the field was explicitly marked as being external.
bool get isExternal {
return hasModifier(Modifier.EXTERNAL);
}
- @override
+ /// Whether the field can be type promoted.
bool get isPromotable {
return hasModifier(Modifier.PROMOTABLE);
}
@@ -4202,11 +4205,7 @@
/// Common base class for all analyzer-internal classes that implement
/// `FieldElement`.
-abstract class FieldElementOrMember
- implements
- PropertyInducingElementOrMember,
- // ignore:deprecated_member_use_from_same_package,analyzer_use_new_elements
- FieldElement {
+abstract class FieldElementOrMember implements PropertyInducingElementOrMember {
@override
FieldElementImpl get declaration;