@@ -362,8 +362,7 @@ abstract class ClassFragment implements InterfaceFragment {
362362/// type.
363363///
364364/// Clients may not extend, implement or mix-in this class.
365- abstract class ConstructorElement
366- implements ExecutableElement , HasSinceSdkVersion {
365+ abstract class ConstructorElement implements ExecutableElement {
367366 @override
368367 ConstructorElement get baseElement;
369368
@@ -716,6 +715,23 @@ abstract class Element {
716715 /// The analysis session in which this element is defined.
717716 AnalysisSession ? get session;
718717
718+ /// The version where the associated SDK API was added.
719+ ///
720+ /// A `@Since()` annotation can be applied to a library declaration,
721+ /// any public declaration in a library, or in a class, or to an optional
722+ /// parameter, etc.
723+ ///
724+ /// The returned version is "effective", so that if a library is annotated
725+ /// then all elements of the library inherit it; or if a class is annotated
726+ /// then all members and constructors of the class inherit it.
727+ ///
728+ /// If multiple `@Since()` annotations apply to the same element, the latest
729+ /// version takes precedence.
730+ ///
731+ /// Returns `null` if the element is not declared in the SDK, or doesn't have
732+ /// a `@Since()` annotation applied to it.
733+ Version ? get sinceSdkVersion;
734+
719735 /// Uses the given [visitor] to visit this element.
720736 ///
721737 /// Returns the value returned by the visitor as a result of visiting this
@@ -1565,7 +1581,7 @@ abstract class FieldFragment implements PropertyInducingFragment {
15651581///
15661582/// Clients may not extend, implement or mix-in this class.
15671583abstract class FormalParameterElement
1568- implements VariableElement , Annotatable , HasSinceSdkVersion , LocalElement {
1584+ implements VariableElement , Annotatable , LocalElement {
15691585 @override
15701586 FormalParameterElement get baseElement;
15711587
@@ -1958,27 +1974,6 @@ abstract class GetterFragment implements PropertyAccessorFragment {
19581974 GetterFragment ? get previousFragment;
19591975}
19601976
1961- /// The interface that is implemented by elements that can have `@Since()`
1962- /// annotation.
1963- abstract class HasSinceSdkVersion {
1964- /// The version where the associated SDK API was added.
1965- ///
1966- /// A `@Since()` annotation can be applied to a library declaration,
1967- /// any public declaration in a library, or in a class, or to an optional
1968- /// parameter, etc.
1969- ///
1970- /// The returned version is "effective", so that if a library is annotated
1971- /// then all elements of the library inherit it; or if a class is annotated
1972- /// then all members and constructors of the class inherit it.
1973- ///
1974- /// If multiple `@Since()` annotations apply to the same element, the latest
1975- /// version takes precedence.
1976- ///
1977- /// Returns `null` if the element is not declared in the SDK, or doesn't have
1978- /// a `@Since()` annotation applied to it.
1979- Version ? get sinceSdkVersion;
1980- }
1981-
19821977/// A combinator that causes some of the names in a namespace to be hidden when
19831978/// being imported.
19841979///
@@ -1993,10 +1988,7 @@ abstract class HideElementCombinator implements NamespaceCombinator {
19931988///
19941989/// Clients may not extend, implement or mix-in this class.
19951990abstract class InstanceElement
1996- implements
1997- TypeDefiningElement ,
1998- TypeParameterizedElement ,
1999- HasSinceSdkVersion {
1991+ implements TypeDefiningElement , TypeParameterizedElement {
20001992 @override
20011993 InstanceElement get baseElement;
20021994
@@ -2572,8 +2564,7 @@ abstract class LabelFragment implements Fragment {
25722564/// A library.
25732565///
25742566/// Clients may not extend, implement or mix-in this class.
2575- abstract class LibraryElement
2576- implements Element , Annotatable , HasSinceSdkVersion {
2567+ abstract class LibraryElement implements Element , Annotatable {
25772568 /// The classes defined in this library.
25782569 ///
25792570 /// There is no guarantee of the order in which the classes will be returned.
@@ -3193,7 +3184,7 @@ abstract class Metadata {
31933184/// method.
31943185///
31953186/// Clients may not extend, implement or mix-in this class.
3196- abstract class MethodElement implements ExecutableElement , HasSinceSdkVersion {
3187+ abstract class MethodElement implements ExecutableElement {
31973188 /// The name of the method that can be implemented by a class to allow its
31983189 /// instances to be invoked as if they were a function.
31993190 static final String CALL_METHOD_NAME = "call" ;
@@ -3532,8 +3523,7 @@ abstract class PropertyAccessorFragment implements ExecutableFragment {
35323523/// [PropertyInducingElement] .
35333524///
35343525/// Clients may not extend, implement or mix-in this class.
3535- abstract class PropertyInducingElement
3536- implements VariableElement , Annotatable , HasSinceSdkVersion {
3526+ abstract class PropertyInducingElement implements VariableElement , Annotatable {
35373527 @override
35383528 PropertyInducingFragment get firstFragment;
35393529
@@ -3730,8 +3720,7 @@ abstract class SuperFormalParameterFragment implements FormalParameterFragment {
37303720/// A top-level function.
37313721///
37323722/// Clients may not extend, implement or mix-in this class.
3733- abstract class TopLevelFunctionElement
3734- implements ExecutableElement , HasSinceSdkVersion {
3723+ abstract class TopLevelFunctionElement implements ExecutableElement {
37353724 /// The name of the function used as an entry point.
37363725 static const String MAIN_FUNCTION_NAME = "main" ;
37373726
@@ -3808,10 +3797,7 @@ abstract class TopLevelVariableFragment implements PropertyInducingFragment {
38083797///
38093798/// Clients may not extend, implement or mix-in this class.
38103799abstract class TypeAliasElement
3811- implements
3812- TypeParameterizedElement ,
3813- TypeDefiningElement ,
3814- HasSinceSdkVersion {
3800+ implements TypeParameterizedElement , TypeDefiningElement {
38153801 /// If the aliased type has structure, return the corresponding element.
38163802 /// For example, it could be [GenericFunctionTypeElement] .
38173803 ///
0 commit comments