Remove 'featureSet' from TestAnalysisContext.
Change-Id: Ide3eb73562aa70b0daf82d12f66f2001b7a3c735
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213533
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/test/generated/test_analysis_context.dart b/pkg/analyzer/test/generated/test_analysis_context.dart
index 6702b63..840d225 100644
--- a/pkg/analyzer/test/generated/test_analysis_context.dart
+++ b/pkg/analyzer/test/generated/test_analysis_context.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/src/dart/analysis/session.dart';
import 'package:analyzer/src/dart/element/class_hierarchy.dart';
import 'package:analyzer/src/dart/element/element.dart';
@@ -18,7 +17,7 @@
final SourceFactory sourceFactory = _MockSourceFactory();
final _MockAnalysisSession _analysisSession = _MockAnalysisSession();
- late AnalysisOptionsImpl _analysisOptions;
+ final AnalysisOptionsImpl _analysisOptions = AnalysisOptionsImpl();
late TypeProviderImpl _typeProviderLegacy;
late TypeProviderImpl _typeProviderNonNullableByDefault;
@@ -26,10 +25,7 @@
late TypeSystemImpl _typeSystemLegacy;
late TypeSystemImpl _typeSystemNonNullableByDefault;
- TestAnalysisContext({FeatureSet? featureSet}) {
- _analysisOptions = AnalysisOptionsImpl()
- ..contextFeatures = featureSet ?? FeatureSet.latestLanguageVersion();
-
+ TestAnalysisContext() {
var sdkElements = MockSdkElements(this, _analysisSession);
_typeProviderLegacy = TypeProviderImpl(
diff --git a/pkg/analyzer/test/generated/type_system_test.dart b/pkg/analyzer/test/generated/type_system_test.dart
index 1f36c75..a0f6b1e 100644
--- a/pkg/analyzer/test/generated/type_system_test.dart
+++ b/pkg/analyzer/test/generated/type_system_test.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/element/type.dart';
@@ -35,14 +34,8 @@
late TypeSystemImpl typeSystem;
- FeatureSet get testFeatureSet {
- return FeatureSet.latestLanguageVersion();
- }
-
void setUp() {
- analysisContext = TestAnalysisContext(
- featureSet: testFeatureSet,
- );
+ analysisContext = TestAnalysisContext();
typeProvider = analysisContext.typeProviderNonNullableByDefault;
typeSystem = analysisContext.typeSystemNonNullableByDefault;
@@ -66,14 +59,8 @@
late TypeSystemImpl typeSystem;
- FeatureSet get testFeatureSet {
- return FeatureSet.latestLanguageVersion();
- }
-
void setUp() {
- analysisContext = TestAnalysisContext(
- featureSet: testFeatureSet,
- );
+ analysisContext = TestAnalysisContext();
typeProvider = analysisContext.typeProviderLegacy;
typeSystem = analysisContext.typeSystemLegacy;
diff --git a/pkg/analyzer/test/src/dart/element/factor_type_test.dart b/pkg/analyzer/test/src/dart/element/factor_type_test.dart
index fee6ba8..a67d57e 100644
--- a/pkg/analyzer/test/src/dart/element/factor_type_test.dart
+++ b/pkg/analyzer/test/src/dart/element/factor_type_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:_fe_analyzer_shared/src/flow_analysis/factory_type_test_helper.dart';
-import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/dart/element/type_provider.dart';
import 'package:analyzer/src/dart/element/type.dart';
@@ -42,9 +41,7 @@
}
void setUp() {
- var analysisContext = TestAnalysisContext(
- featureSet: FeatureSet.latestLanguageVersion(),
- );
+ var analysisContext = TestAnalysisContext();
typeProvider = analysisContext.typeProviderNonNullableByDefault;
typeSystem = analysisContext.typeSystemNonNullableByDefault;
}