Remove deprecated methods from TypeProvider.
Change-Id: Iaf28b39d5e4efe1f2d0378ad794ccf38bad95254
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222980
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index a38bdd2..36944a5 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -16,6 +16,7 @@
* Removed deprecated `path` and `uri` from `AnalysisResult`.
* Removed deprecated methods from `AnalysisSession`.
* Removed `TypeName` and corresponding methods.
+* Removed deprecated methods from `TypeProvider`.
## 2.8.0
* Deprecations and renames for `getXyz` methods in `AnalysisDriver`.
diff --git a/pkg/analyzer/lib/dart/element/type_provider.dart b/pkg/analyzer/lib/dart/element/type_provider.dart
index 752df98..e75d460 100644
--- a/pkg/analyzer/lib/dart/element/type_provider.dart
+++ b/pkg/analyzer/lib/dart/element/type_provider.dart
@@ -84,11 +84,6 @@
/// Return the type representing the built-in type `Never`.
DartType get neverType;
- /// Return a list containing all of the types that cannot be either extended
- /// or implemented.
- @Deprecated('Use isNonSubtypableClass instead')
- Set<ClassElement> get nonSubtypableClasses;
-
/// Return the element representing the built-in class `Null`.
ClassElement get nullElement;
@@ -138,20 +133,10 @@
/// given [valueType]. The type has the nullability suffix of this provider.
InterfaceType futureOrType(DartType valueType);
- /// Return the instantiation of the built-in class `FutureOr` with the
- /// given [valueType]. The type has the nullability suffix of this provider.
- @Deprecated('Use futureOrType instead')
- InterfaceType futureOrType2(DartType valueType);
-
/// Return the instantiation of the built-in class `Future` with the
/// given [valueType]. The type has the nullability suffix of this provider.
InterfaceType futureType(DartType valueType);
- /// Return the instantiation of the built-in class `Future` with the
- /// given [valueType]. The type has the nullability suffix of this provider.
- @Deprecated('Use futureType instead')
- InterfaceType futureType2(DartType valueType);
-
/// Return `true` if [element] cannot be extended, implemented, or mixed in.
bool isNonSubtypableClass(ClassElement element);
@@ -169,46 +154,20 @@
/// given [elementType]. The type has the nullability suffix of this provider.
InterfaceType iterableType(DartType elementType);
- /// Return the instantiation of the built-in class `Iterable` with the
- /// given [elementType]. The type has the nullability suffix of this provider.
- @Deprecated('Use iterableType instead')
- InterfaceType iterableType2(DartType elementType);
-
/// Return the instantiation of the built-in class `List` with the
/// given [elementType]. The type has the nullability suffix of this provider.
InterfaceType listType(DartType elementType);
/// Return the instantiation of the built-in class `List` with the
- /// given [elementType]. The type has the nullability suffix of this provider.
- @Deprecated('Use listType instead')
- InterfaceType listType2(DartType elementType);
-
- /// Return the instantiation of the built-in class `List` with the
/// given [keyType] and [valueType]. The type has the nullability suffix of
/// this provider.
InterfaceType mapType(DartType keyType, DartType valueType);
- /// Return the instantiation of the built-in class `List` with the
- /// given [keyType] and [valueType]. The type has the nullability suffix of
- /// this provider.
- @Deprecated('Use mapType instead')
- InterfaceType mapType2(DartType keyType, DartType valueType);
-
/// Return the instantiation of the built-in class `Set` with the
/// given [elementType]. The type has the nullability suffix of this provider.
InterfaceType setType(DartType elementType);
- /// Return the instantiation of the built-in class `Set` with the
- /// given [elementType]. The type has the nullability suffix of this provider.
- @Deprecated('Use setType instead')
- InterfaceType setType2(DartType elementType);
-
/// Return the instantiation of the built-in class `Stream` with the
/// given [elementType]. The type has the nullability suffix of this provider.
InterfaceType streamType(DartType elementType);
-
- /// Return the instantiation of the built-in class `Stream` with the
- /// given [elementType]. The type has the nullability suffix of this provider.
- @Deprecated('Use streamType instead')
- InterfaceType streamType2(DartType elementType);
}
diff --git a/pkg/analyzer/lib/src/dart/element/type_provider.dart b/pkg/analyzer/lib/src/dart/element/type_provider.dart
index 948b8c448..15242b5 100644
--- a/pkg/analyzer/lib/src/dart/element/type_provider.dart
+++ b/pkg/analyzer/lib/src/dart/element/type_provider.dart
@@ -149,8 +149,6 @@
InterfaceType? _nullStar;
- Set<ClassElement>? _nonSubtypableClasses;
-
/// Initialize a newly created type provider to provide the types defined in
/// the given [coreLibrary] and [asyncLibrary].
TypeProviderImpl({
@@ -353,18 +351,6 @@
? NeverTypeImpl.instance
: NeverTypeImpl.instanceLegacy;
- @Deprecated('Use isNonSubtypableClass instead')
- @override
- Set<ClassElement> get nonSubtypableClasses => _nonSubtypableClasses ??= {
- boolElement,
- doubleElement,
- futureOrElement,
- intElement,
- nullElement,
- numElement,
- stringElement,
- };
-
@override
ClassElement get nullElement {
return _nullElement ??= _getClassElement(_coreLibrary, 'Null');
@@ -473,12 +459,6 @@
);
}
- @Deprecated('Use futureOrType instead')
- @override
- InterfaceType futureOrType2(DartType valueType) {
- return futureOrType(valueType);
- }
-
@override
InterfaceType futureType(DartType valueType) {
return futureElement.instantiate(
@@ -487,12 +467,6 @@
);
}
- @Deprecated('Use futureType instead')
- @override
- InterfaceType futureType2(DartType valueType) {
- return futureType(valueType);
- }
-
@override
bool isNonSubtypableClass(ClassElement element) {
var name = element.name;
@@ -512,12 +486,6 @@
);
}
- @Deprecated('Use iterableType instead')
- @override
- InterfaceType iterableType2(DartType elementType) {
- return iterableType(elementType);
- }
-
@override
InterfaceType listType(DartType elementType) {
return listElement.instantiate(
@@ -526,12 +494,6 @@
);
}
- @Deprecated('Use listType instead')
- @override
- InterfaceType listType2(DartType elementType) {
- return listType(elementType);
- }
-
@override
InterfaceType mapType(DartType keyType, DartType valueType) {
return mapElement.instantiate(
@@ -540,12 +502,6 @@
);
}
- @Deprecated('Use mapType instead')
- @override
- InterfaceType mapType2(DartType keyType, DartType valueType) {
- return mapType(keyType, valueType);
- }
-
@override
InterfaceType setType(DartType elementType) {
return setElement.instantiate(
@@ -554,12 +510,6 @@
);
}
- @Deprecated('Use setType instead')
- @override
- InterfaceType setType2(DartType elementType) {
- return setType(elementType);
- }
-
@override
InterfaceType streamType(DartType elementType) {
return streamElement.instantiate(
@@ -568,12 +518,6 @@
);
}
- @Deprecated('Use streamType instead')
- @override
- InterfaceType streamType2(DartType elementType) {
- return streamType(elementType);
- }
-
/// Return the class with the given [name] from the given [library], or
/// throw a [StateError] if there is no class with the given name.
ClassElement _getClassElement(LibraryElement library, String name) {