Skip to content

Commit 4122236

Browse files
scheglovCommit Bot
authored and
Commit Bot
committed
Remove deprecated methods from TypeProvider.
Change-Id: Iaf28b39d5e4efe1f2d0378ad794ccf38bad95254 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222980 Reviewed-by: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 5cc2d95 commit 4122236

File tree

3 files changed

+1
-97
lines changed

3 files changed

+1
-97
lines changed

pkg/analyzer/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Removed deprecated `path` and `uri` from `AnalysisResult`.
1717
* Removed deprecated methods from `AnalysisSession`.
1818
* Removed `TypeName` and corresponding methods.
19+
* Removed deprecated methods from `TypeProvider`.
1920

2021
## 2.8.0
2122
* Deprecations and renames for `getXyz` methods in `AnalysisDriver`.

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ abstract class TypeProvider {
8484
/// Return the type representing the built-in type `Never`.
8585
DartType get neverType;
8686

87-
/// Return a list containing all of the types that cannot be either extended
88-
/// or implemented.
89-
@Deprecated('Use isNonSubtypableClass instead')
90-
Set<ClassElement> get nonSubtypableClasses;
91-
9287
/// Return the element representing the built-in class `Null`.
9388
ClassElement get nullElement;
9489

@@ -138,20 +133,10 @@ abstract class TypeProvider {
138133
/// given [valueType]. The type has the nullability suffix of this provider.
139134
InterfaceType futureOrType(DartType valueType);
140135

141-
/// Return the instantiation of the built-in class `FutureOr` with the
142-
/// given [valueType]. The type has the nullability suffix of this provider.
143-
@Deprecated('Use futureOrType instead')
144-
InterfaceType futureOrType2(DartType valueType);
145-
146136
/// Return the instantiation of the built-in class `Future` with the
147137
/// given [valueType]. The type has the nullability suffix of this provider.
148138
InterfaceType futureType(DartType valueType);
149139

150-
/// Return the instantiation of the built-in class `Future` with the
151-
/// given [valueType]. The type has the nullability suffix of this provider.
152-
@Deprecated('Use futureType instead')
153-
InterfaceType futureType2(DartType valueType);
154-
155140
/// Return `true` if [element] cannot be extended, implemented, or mixed in.
156141
bool isNonSubtypableClass(ClassElement element);
157142

@@ -169,46 +154,20 @@ abstract class TypeProvider {
169154
/// given [elementType]. The type has the nullability suffix of this provider.
170155
InterfaceType iterableType(DartType elementType);
171156

172-
/// Return the instantiation of the built-in class `Iterable` with the
173-
/// given [elementType]. The type has the nullability suffix of this provider.
174-
@Deprecated('Use iterableType instead')
175-
InterfaceType iterableType2(DartType elementType);
176-
177157
/// Return the instantiation of the built-in class `List` with the
178158
/// given [elementType]. The type has the nullability suffix of this provider.
179159
InterfaceType listType(DartType elementType);
180160

181-
/// Return the instantiation of the built-in class `List` with the
182-
/// given [elementType]. The type has the nullability suffix of this provider.
183-
@Deprecated('Use listType instead')
184-
InterfaceType listType2(DartType elementType);
185-
186161
/// Return the instantiation of the built-in class `List` with the
187162
/// given [keyType] and [valueType]. The type has the nullability suffix of
188163
/// this provider.
189164
InterfaceType mapType(DartType keyType, DartType valueType);
190165

191-
/// Return the instantiation of the built-in class `List` with the
192-
/// given [keyType] and [valueType]. The type has the nullability suffix of
193-
/// this provider.
194-
@Deprecated('Use mapType instead')
195-
InterfaceType mapType2(DartType keyType, DartType valueType);
196-
197166
/// Return the instantiation of the built-in class `Set` with the
198167
/// given [elementType]. The type has the nullability suffix of this provider.
199168
InterfaceType setType(DartType elementType);
200169

201-
/// Return the instantiation of the built-in class `Set` with the
202-
/// given [elementType]. The type has the nullability suffix of this provider.
203-
@Deprecated('Use setType instead')
204-
InterfaceType setType2(DartType elementType);
205-
206170
/// Return the instantiation of the built-in class `Stream` with the
207171
/// given [elementType]. The type has the nullability suffix of this provider.
208172
InterfaceType streamType(DartType elementType);
209-
210-
/// Return the instantiation of the built-in class `Stream` with the
211-
/// given [elementType]. The type has the nullability suffix of this provider.
212-
@Deprecated('Use streamType instead')
213-
InterfaceType streamType2(DartType elementType);
214173
}

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

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ class TypeProviderImpl extends TypeProviderBase {
149149

150150
InterfaceType? _nullStar;
151151

152-
Set<ClassElement>? _nonSubtypableClasses;
153-
154152
/// Initialize a newly created type provider to provide the types defined in
155153
/// the given [coreLibrary] and [asyncLibrary].
156154
TypeProviderImpl({
@@ -353,18 +351,6 @@ class TypeProviderImpl extends TypeProviderBase {
353351
? NeverTypeImpl.instance
354352
: NeverTypeImpl.instanceLegacy;
355353

356-
@Deprecated('Use isNonSubtypableClass instead')
357-
@override
358-
Set<ClassElement> get nonSubtypableClasses => _nonSubtypableClasses ??= {
359-
boolElement,
360-
doubleElement,
361-
futureOrElement,
362-
intElement,
363-
nullElement,
364-
numElement,
365-
stringElement,
366-
};
367-
368354
@override
369355
ClassElement get nullElement {
370356
return _nullElement ??= _getClassElement(_coreLibrary, 'Null');
@@ -473,12 +459,6 @@ class TypeProviderImpl extends TypeProviderBase {
473459
);
474460
}
475461

476-
@Deprecated('Use futureOrType instead')
477-
@override
478-
InterfaceType futureOrType2(DartType valueType) {
479-
return futureOrType(valueType);
480-
}
481-
482462
@override
483463
InterfaceType futureType(DartType valueType) {
484464
return futureElement.instantiate(
@@ -487,12 +467,6 @@ class TypeProviderImpl extends TypeProviderBase {
487467
);
488468
}
489469

490-
@Deprecated('Use futureType instead')
491-
@override
492-
InterfaceType futureType2(DartType valueType) {
493-
return futureType(valueType);
494-
}
495-
496470
@override
497471
bool isNonSubtypableClass(ClassElement element) {
498472
var name = element.name;
@@ -512,12 +486,6 @@ class TypeProviderImpl extends TypeProviderBase {
512486
);
513487
}
514488

515-
@Deprecated('Use iterableType instead')
516-
@override
517-
InterfaceType iterableType2(DartType elementType) {
518-
return iterableType(elementType);
519-
}
520-
521489
@override
522490
InterfaceType listType(DartType elementType) {
523491
return listElement.instantiate(
@@ -526,12 +494,6 @@ class TypeProviderImpl extends TypeProviderBase {
526494
);
527495
}
528496

529-
@Deprecated('Use listType instead')
530-
@override
531-
InterfaceType listType2(DartType elementType) {
532-
return listType(elementType);
533-
}
534-
535497
@override
536498
InterfaceType mapType(DartType keyType, DartType valueType) {
537499
return mapElement.instantiate(
@@ -540,12 +502,6 @@ class TypeProviderImpl extends TypeProviderBase {
540502
);
541503
}
542504

543-
@Deprecated('Use mapType instead')
544-
@override
545-
InterfaceType mapType2(DartType keyType, DartType valueType) {
546-
return mapType(keyType, valueType);
547-
}
548-
549505
@override
550506
InterfaceType setType(DartType elementType) {
551507
return setElement.instantiate(
@@ -554,12 +510,6 @@ class TypeProviderImpl extends TypeProviderBase {
554510
);
555511
}
556512

557-
@Deprecated('Use setType instead')
558-
@override
559-
InterfaceType setType2(DartType elementType) {
560-
return setType(elementType);
561-
}
562-
563513
@override
564514
InterfaceType streamType(DartType elementType) {
565515
return streamElement.instantiate(
@@ -568,12 +518,6 @@ class TypeProviderImpl extends TypeProviderBase {
568518
);
569519
}
570520

571-
@Deprecated('Use streamType instead')
572-
@override
573-
InterfaceType streamType2(DartType elementType) {
574-
return streamType(elementType);
575-
}
576-
577521
/// Return the class with the given [name] from the given [library], or
578522
/// throw a [StateError] if there is no class with the given name.
579523
ClassElement _getClassElement(LibraryElement library, String name) {

0 commit comments

Comments
 (0)