Skip to content

Commit b46ee2c

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Deprecate TypeAliasElement.
Change-Id: I0cbcb9e3cf0fac76ebed59cabc4dc4b5205c78ae Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418908 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Paul Berry <[email protected]>
1 parent c94331f commit b46ee2c

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

pkg/analyzer/api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3499,7 +3499,7 @@ package:analyzer/dart/element/element.dart:
34993499
new (constructor: TopLevelVariableElement Function())
35003500
declaration (getter: TopLevelVariableElement)
35013501
isExternal (getter: bool)
3502-
TypeAliasElement (class extends Object implements TypeParameterizedElement, TypeDefiningElement):
3502+
TypeAliasElement (class extends Object implements TypeParameterizedElement, TypeDefiningElement, deprecated):
35033503
new (constructor: TypeAliasElement Function())
35043504
aliasedElement (getter: Element?, deprecated)
35053505
aliasedType (getter: DartType)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,6 +2186,7 @@ abstract class TopLevelVariableElement implements PropertyInducingElement {
21862186
/// A type alias (`typedef`).
21872187
///
21882188
/// Clients may not extend, implement or mix-in this class.
2189+
@Deprecated('Use TypeAliasElement2 instead')
21892190
abstract class TypeAliasElement
21902191
implements TypeParameterizedElement, TypeDefiningElement {
21912192
/// If the aliased type has structure, return the corresponding element.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10985,8 +10985,13 @@ class TopLevelVariableElementImpl2 extends PropertyInducingElementImpl2
1098510985
///
1098610986
/// Clients may not extend, implement or mix-in this class.
1098710987
class TypeAliasElementImpl extends _ExistingElementImpl
10988-
with AugmentableFragment, TypeParameterizedElementMixin
10989-
implements TypeAliasElement, TypeAliasFragment {
10988+
with
10989+
AugmentableFragment,
10990+
TypeParameterizedElementMixin
10991+
implements
10992+
// ignore:deprecated_member_use_from_same_package
10993+
TypeAliasElement,
10994+
TypeAliasFragment {
1099010995
@override
1099110996
String? name2;
1099210997

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -689,18 +689,6 @@ extension TopLevelVariableElementImpl2Extension
689689
}
690690
}
691691

692-
extension TypeAliasElement2Extension on TypeAliasElement2 {
693-
TypeAliasElement get asElement {
694-
return firstFragment as TypeAliasElement;
695-
}
696-
}
697-
698-
extension TypeAliasElementExtension on TypeAliasElement {
699-
TypeAliasElement2 get asElement2 {
700-
return (this as TypeAliasElementImpl).element;
701-
}
702-
}
703-
704692
extension TypeAliasElementImpl2Extension on TypeAliasElementImpl2 {
705693
TypeAliasElementImpl get asElement {
706694
return firstFragment;

0 commit comments

Comments
 (0)