remove `TypeSystemImpl.strict`{`Casts`|`Inference`}
Fixes: https://github.com/dart-lang/sdk/issues/53873
Change-Id: I8cb982c8f6549a604c6815cfebbeede27f56b030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342102
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 330e094..bb1acc2 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -40,17 +40,6 @@
// TODO(scheglov): Remove it, exists only for Cider.
set analysisOptions(AnalysisOptionsImpl analysisOptions) {
_analysisOptions = analysisOptions;
-
- // TODO(scheglov): remove this method as well
- _typeSystemLegacy?.updateOptions(
- strictCasts: analysisOptions.strictCasts,
- strictInference: analysisOptions.strictInference,
- );
-
- _typeSystemNonNullableByDefault?.updateOptions(
- strictCasts: analysisOptions.strictCasts,
- strictInference: analysisOptions.strictInference,
- );
}
bool get hasTypeProvider {
@@ -95,23 +84,11 @@
_typeSystemLegacy = TypeSystemImpl(
isNonNullableByDefault: false,
- // TODO(pq): move type system options to accommodate multiple options per context
- // https://github.com/dart-lang/sdk/issues/53873
- // ignore: deprecated_member_use_from_same_package
- strictCasts: analysisOptions.strictCasts,
- // ignore: deprecated_member_use_from_same_package
- strictInference: analysisOptions.strictInference,
typeProvider: legacy,
);
_typeSystemNonNullableByDefault = TypeSystemImpl(
isNonNullableByDefault: true,
- // TODO(pq): move type system options to accommodate multiple options per context
- // https://github.com/dart-lang/sdk/issues/53873
- // ignore: deprecated_member_use_from_same_package
- strictCasts: analysisOptions.strictCasts,
- // ignore: deprecated_member_use_from_same_package
- strictInference: analysisOptions.strictInference,
typeProvider: nonNullableByDefault,
);
diff --git a/pkg/analyzer/lib/src/dart/constant/value.dart b/pkg/analyzer/lib/src/dart/constant/value.dart
index ce3e0e8..77aeb42 100644
--- a/pkg/analyzer/lib/src/dart/constant/value.dart
+++ b/pkg/analyzer/lib/src/dart/constant/value.dart
@@ -607,8 +607,6 @@
TypeProvider typeProvider, DartObjectImpl rightOperand) {
var typeSystem = TypeSystemImpl(
isNonNullableByDefault: false,
- strictCasts: false,
- strictInference: false,
typeProvider: typeProvider,
);
return isIdentical2(typeSystem, rightOperand);
diff --git a/pkg/analyzer/lib/src/dart/element/type_system.dart b/pkg/analyzer/lib/src/dart/element/type_system.dart
index 03b67b1..db90004 100644
--- a/pkg/analyzer/lib/src/dart/element/type_system.dart
+++ b/pkg/analyzer/lib/src/dart/element/type_system.dart
@@ -74,20 +74,6 @@
/// The provider of types for the system.
final TypeProviderImpl typeProvider;
- /// True if "strict casts" should be enforced.
- ///
- /// This affects the behavior of [isAssignableTo].
- // TODO(pq): remove (https://github.com/dart-lang/sdk/issues/53873)
- @deprecated
- bool strictCasts;
-
- /// A flag indicating whether inference failures are allowed, off by default.
- ///
- /// This option is experimental and subject to change.
- // TODO(pq): remove (https://github.com/dart-lang/sdk/issues/53873)
- @deprecated
- bool strictInference;
-
/// The cached instance of `Object?`.
InterfaceTypeImpl? _objectQuestion;
@@ -108,8 +94,6 @@
TypeSystemImpl({
required this.isNonNullableByDefault,
- @deprecated required this.strictCasts,
- @deprecated required this.strictInference,
required TypeProvider typeProvider,
}) : typeProvider = typeProvider as TypeProviderImpl {
_greatestLowerBoundHelper = GreatestLowerBoundHelper(this);
@@ -1959,16 +1943,6 @@
}
}
- void updateOptions({
- required bool strictCasts,
- required bool strictInference,
- }) {
- // ignore: deprecated_member_use_from_same_package
- this.strictCasts = strictCasts;
- // ignore: deprecated_member_use_from_same_package
- this.strictInference = strictInference;
- }
-
/// Optimistically estimates, if type arguments of [left] can be equal to
/// the type arguments of [right]. Both types must be instantiations of the
/// same element.
diff --git a/pkg/analyzer/test/generated/test_analysis_context.dart b/pkg/analyzer/test/generated/test_analysis_context.dart
index 73c44a3..d9b928f 100644
--- a/pkg/analyzer/test/generated/test_analysis_context.dart
+++ b/pkg/analyzer/test/generated/test_analysis_context.dart
@@ -43,15 +43,11 @@
_typeSystemLegacy = TypeSystemImpl(
isNonNullableByDefault: false,
- strictCasts: _analysisOptions.strictCasts,
- strictInference: _analysisOptions.strictInference,
typeProvider: _typeProviderLegacy,
);
_typeSystemNonNullableByDefault = TypeSystemImpl(
isNonNullableByDefault: true,
- strictCasts: _analysisOptions.strictCasts,
- strictInference: _analysisOptions.strictInference,
typeProvider: _typeProviderNonNullableByDefault,
);