Skip to content

Commit ea17045

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

File tree

3 files changed

+11
-49
lines changed

3 files changed

+11
-49
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,7 +3224,6 @@ package:analyzer/dart/element/element.dart:
32243224
name (getter: String)
32253225
parameterKind (getter: ParameterKind, deprecated)
32263226
parameters (getter: List<ParameterElement>)
3227-
typeParameters (getter: List<TypeParameterElement>, deprecated)
32283227
appendToWithoutDelimiters (method: void Function(StringBuffer, {bool withNullability}))
32293228
PartElement (class extends Object implements _ExistingElement, deprecated):
32303229
new (constructor: PartElement Function())
@@ -3246,13 +3245,6 @@ package:analyzer/dart/element/element.dart:
32463245
shownNames (getter: List<String>)
32473246
TypeDefiningElement (class extends Object implements Element, deprecated):
32483247
new (constructor: TypeDefiningElement Function())
3249-
TypeParameterElement (class extends Object implements TypeDefiningElement, deprecated):
3250-
new (constructor: TypeParameterElement Function())
3251-
bound (getter: DartType?)
3252-
declaration (getter: TypeParameterElement)
3253-
displayName (getter: String)
3254-
name (getter: String)
3255-
instantiate (method: TypeParameterType Function({required NullabilitySuffix nullabilitySuffix}))
32563248
UndefinedElement (class extends Object implements Element, deprecated):
32573249
new (constructor: UndefinedElement Function())
32583250
UriReferencedElement (class extends Object implements _ExistingElement, deprecated):

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,13 +1108,6 @@ abstract class ParameterElement
11081108
/// parameter.
11091109
List<ParameterElement> get parameters;
11101110

1111-
/// The type parameters defined by this parameter.
1112-
///
1113-
/// A parameter will only define type parameters if it is a function typed
1114-
/// parameter.
1115-
@Deprecated(elementModelDeprecationMsg)
1116-
List<TypeParameterElement> get typeParameters;
1117-
11181111
/// Appends the type, name and possibly the default value of this parameter
11191112
/// to the given [buffer].
11201113
void appendToWithoutDelimiters(
@@ -1193,33 +1186,6 @@ abstract class ShowElementCombinator implements NamespaceCombinator {
11931186
@Deprecated('Use TypeDefiningElement2 instead')
11941187
abstract class TypeDefiningElement implements Element {}
11951188

1196-
/// A type parameter.
1197-
///
1198-
/// Clients may not extend, implement or mix-in this class.
1199-
@Deprecated('Use TypeParameterElement2 instead')
1200-
abstract class TypeParameterElement implements TypeDefiningElement {
1201-
/// The type representing the bound associated with this parameter, or `null`
1202-
/// if this parameter does not have an explicit bound. Being able to
1203-
/// distinguish between an implicit and explicit bound is needed by the
1204-
/// instantiate to bounds algorithm.
1205-
DartType? get bound;
1206-
1207-
@override
1208-
TypeParameterElement get declaration;
1209-
1210-
@override
1211-
String get displayName;
1212-
1213-
@override
1214-
String get name;
1215-
1216-
/// Creates the [TypeParameterType] with the given [nullabilitySuffix] for
1217-
/// this type parameter.
1218-
TypeParameterType instantiate({
1219-
required NullabilitySuffix nullabilitySuffix,
1220-
});
1221-
}
1222-
12231189
/// A pseudo-elements that represents names that are undefined. This situation
12241190
/// is not allowed by the language, so objects implementing this interface
12251191
/// always represent an error. As a result, most of the normal operations on

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8875,7 +8875,10 @@ mixin ParameterElementMixin
88758875
@override
88768876
TypeImpl get type;
88778877

8878-
@override
8878+
/// The type parameters defined by this parameter.
8879+
///
8880+
/// A parameter will only define type parameters if it is a function typed
8881+
/// parameter.
88798882
List<TypeParameterElementImpl> get typeParameters;
88808883

88818884
@override
@@ -10603,10 +10606,7 @@ abstract class TypeDefiningElementImpl2 extends ElementImpl2
1060310606
implements TypeDefiningElement2 {}
1060410607

1060510608
class TypeParameterElementImpl extends ElementImpl
10606-
implements
10607-
// ignore:deprecated_member_use_from_same_package,analyzer_use_new_elements
10608-
TypeParameterElement,
10609-
TypeParameterFragment {
10609+
implements TypeParameterFragment {
1061010610
@override
1061110611
String? name2;
1061210612

@@ -10639,7 +10639,10 @@ class TypeParameterElementImpl extends ElementImpl
1063910639
isSynthetic = true;
1064010640
}
1064110641

10642-
@override
10642+
/// The type representing the bound associated with this parameter, or `null`
10643+
/// if this parameter does not have an explicit bound. Being able to
10644+
/// distinguish between an implicit and explicit bound is needed by the
10645+
/// instantiate to bounds algorithm.
1064310646
TypeImpl? get bound {
1064410647
return _bound;
1064510648
}
@@ -10774,7 +10777,8 @@ class TypeParameterElementImpl extends ElementImpl
1077410777
return shared.Variance.unrelated;
1077510778
}
1077610779

10777-
@override
10780+
/// Creates the [TypeParameterType] with the given [nullabilitySuffix] for
10781+
/// this type parameter.
1077810782
TypeParameterTypeImpl instantiate({
1077910783
required NullabilitySuffix nullabilitySuffix,
1078010784
}) {

0 commit comments

Comments
 (0)