diff --git a/pkg/_fe_analyzer_shared/lib/src/experiments/flags.dart b/pkg/_fe_analyzer_shared/lib/src/experiments/flags.dart index 8c4c79d2490..1234f031924 100644 --- a/pkg/_fe_analyzer_shared/lib/src/experiments/flags.dart +++ b/pkg/_fe_analyzer_shared/lib/src/experiments/flags.dart @@ -109,7 +109,7 @@ enum ExperimentalFlag { getterSetterError( name: 'getter-setter-error', isEnabledByDefault: true, - isExpired: false, + isExpired: true, experimentEnabledVersion: const Version(3, 9), experimentReleasedVersion: const Version(3, 9), ), @@ -181,7 +181,7 @@ enum ExperimentalFlag { nativeAssets( name: 'native-assets', isEnabledByDefault: true, - isExpired: false, + isExpired: true, experimentEnabledVersion: const Version(3, 9), experimentReleasedVersion: const Version(3, 9), ), @@ -205,7 +205,7 @@ enum ExperimentalFlag { nullAwareElements( name: 'null-aware-elements', isEnabledByDefault: true, - isExpired: false, + isExpired: true, experimentEnabledVersion: const Version(3, 8), experimentReleasedVersion: const Version(3, 8), ), @@ -253,7 +253,7 @@ enum ExperimentalFlag { soundFlowAnalysis( name: 'sound-flow-analysis', isEnabledByDefault: true, - isExpired: false, + isExpired: true, experimentEnabledVersion: const Version(3, 9), experimentReleasedVersion: const Version(3, 9), ), diff --git a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart index b36b6b57570..7a1b07d219c 100644 --- a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart +++ b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart @@ -785,7 +785,7 @@ class IsExpired { static const bool generic_metadata = true; /// Expiration status of the experiment "getter-setter-error" - static const bool getter_setter_error = false; + static const bool getter_setter_error = true; /// Expiration status of the experiment "inference-update-1" static const bool inference_update_1 = true; @@ -812,7 +812,7 @@ class IsExpired { static const bool named_arguments_anywhere = true; /// Expiration status of the experiment "native-assets" - static const bool native_assets = false; + static const bool native_assets = true; /// Expiration status of the experiment "non-nullable" static const bool non_nullable = true; @@ -821,7 +821,7 @@ class IsExpired { static const bool nonfunction_type_aliases = true; /// Expiration status of the experiment "null-aware-elements" - static const bool null_aware_elements = false; + static const bool null_aware_elements = true; /// Expiration status of the experiment "patterns" static const bool patterns = true; @@ -839,7 +839,7 @@ class IsExpired { static const bool set_literals = true; /// Expiration status of the experiment "sound-flow-analysis" - static const bool sound_flow_analysis = false; + static const bool sound_flow_analysis = true; /// Expiration status of the experiment "spread-collections" static const bool spread_collections = true; diff --git a/pkg/dartdev/test/experiments_test.dart b/pkg/dartdev/test/experiments_test.dart index 681eafe5e77..a5bc8e433e6 100644 --- a/pkg/dartdev/test/experiments_test.dart +++ b/pkg/dartdev/test/experiments_test.dart @@ -3,9 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:dartdev/src/experiments.dart'; -import 'package:dartdev/src/sdk.dart'; import 'package:test/test.dart'; +// ONLY use dedicated test experiments in this test. +// Any other experiment will eventually be retired, and then a test depending +// on it will fail. + void main() { group('experiments', () { test('experimentalFeatures', () { @@ -20,24 +23,5 @@ void main() { final errors = validateExperiments(['foo']); expect(errors, equals(['Unknown experiment: foo'])); }); - - test('native assets experiment', () { - final errors = validateExperiments(['native-assets']); - final channel = Runtime.runtime.channel!; - switch (channel) { - case 'stable': - case 'beta': - expect( - errors, - equals([ - 'Unavailable experiment: native-assets (this experiment is only ' - 'available on the main, dev channels, this current channel is $channel)', - ]), - ); - - default: - expect(errors, isEmpty); - } - }); }); } diff --git a/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart b/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart index a0ffa860087..dcab24caacb 100644 --- a/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart +++ b/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart @@ -173,7 +173,7 @@ class ExperimentalFlag { static const ExperimentalFlag getterSetterError = const ExperimentalFlag( name: 'getter-setter-error', isEnabledByDefault: true, - isExpired: false, + isExpired: true, enabledVersion: const Version(3, 9), experimentEnabledVersion: const Version(3, 9), experimentReleasedVersion: const Version(3, 9), @@ -254,7 +254,7 @@ class ExperimentalFlag { static const ExperimentalFlag nativeAssets = const ExperimentalFlag( name: 'native-assets', isEnabledByDefault: true, - isExpired: false, + isExpired: true, enabledVersion: const Version(3, 9), experimentEnabledVersion: const Version(3, 9), experimentReleasedVersion: const Version(3, 9), @@ -281,7 +281,7 @@ class ExperimentalFlag { static const ExperimentalFlag nullAwareElements = const ExperimentalFlag( name: 'null-aware-elements', isEnabledByDefault: true, - isExpired: false, + isExpired: true, enabledVersion: const Version(3, 8), experimentEnabledVersion: const Version(3, 8), experimentReleasedVersion: const Version(3, 8), @@ -335,7 +335,7 @@ class ExperimentalFlag { static const ExperimentalFlag soundFlowAnalysis = const ExperimentalFlag( name: 'sound-flow-analysis', isEnabledByDefault: true, - isExpired: false, + isExpired: true, enabledVersion: const Version(3, 9), experimentEnabledVersion: const Version(3, 9), experimentReleasedVersion: const Version(3, 9), diff --git a/pkg/front_end/testcases/getter_setter_error/folder.options b/pkg/front_end/testcases/getter_setter_error/folder.options index e383bfb6ee3..e69de29bb2d 100644 --- a/pkg/front_end/testcases/getter_setter_error/folder.options +++ b/pkg/front_end/testcases/getter_setter_error/folder.options @@ -1 +0,0 @@ ---enable-experiment=getter-setter-error diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status index 6dd1f1f3ca0..0bf63a944bf 100644 --- a/pkg/front_end/testcases/textual_outline.status +++ b/pkg/front_end/testcases/textual_outline.status @@ -63,8 +63,3 @@ regress/issue_34850: UnknownChunk # Test has parser errors coverage/external_test: FormatterCrash coverage/operator_unsupported_test: EmptyOutput coverage/syntax_get_set_syntax_test: UnknownChunk - -null_aware_elements/constant_collections: FormatterCrash -null_aware_elements/constant_null_aware_map_entry_shorting: FormatterCrash -null_aware_elements/constant_null_aware_map_entry_shorting_erroneous: FormatterCrash -null_aware_elements/simple_positive: FormatterCrash diff --git a/tests/language/null_aware_elements/const_literals_error_test.dart b/tests/language/null_aware_elements/const_literals_error_test.dart index 694b93868a0..8b32819d3eb 100644 --- a/tests/language/null_aware_elements/const_literals_error_test.dart +++ b/tests/language/null_aware_elements/const_literals_error_test.dart @@ -2,8 +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. -// SharedOptions=--enable-experiment=null-aware-elements - import 'package:expect/expect.dart'; const nullConst = null; diff --git a/tests/language/null_aware_elements/const_literals_test.dart b/tests/language/null_aware_elements/const_literals_test.dart index a148b4b6fbf..ba7597b7b28 100644 --- a/tests/language/null_aware_elements/const_literals_test.dart +++ b/tests/language/null_aware_elements/const_literals_test.dart @@ -2,8 +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. -// SharedOptions=--enable-experiment=null-aware-elements - import 'package:expect/expect.dart'; const nullConst = null; diff --git a/tests/language/null_aware_elements/evaluation_order_test.dart b/tests/language/null_aware_elements/evaluation_order_test.dart index ade8b0eec06..6a7a5f59a07 100644 --- a/tests/language/null_aware_elements/evaluation_order_test.dart +++ b/tests/language/null_aware_elements/evaluation_order_test.dart @@ -2,8 +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. -// SharedOptions=--enable-experiment=null-aware-elements - import 'package:expect/expect.dart'; String log = ""; diff --git a/tests/language/null_aware_elements/flow_analysis_test.dart b/tests/language/null_aware_elements/flow_analysis_test.dart index 5fca9775e64..98e8d61fdcd 100644 --- a/tests/language/null_aware_elements/flow_analysis_test.dart +++ b/tests/language/null_aware_elements/flow_analysis_test.dart @@ -2,8 +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. -// SharedOptions=--enable-experiment=null-aware-elements - import '../static_type_helper.dart'; test1(String a, num x) { diff --git a/tests/language/null_aware_elements/type_inference_maps_test.dart b/tests/language/null_aware_elements/type_inference_maps_test.dart index b648a1b70f3..9a9ce860867 100644 --- a/tests/language/null_aware_elements/type_inference_maps_test.dart +++ b/tests/language/null_aware_elements/type_inference_maps_test.dart @@ -2,8 +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. -// SharedOptions=--enable-experiment=null-aware-elements - import '../static_type_helper.dart'; test(String? key, num? value) { diff --git a/tests/language/null_aware_elements/type_inference_simple_error_test.dart b/tests/language/null_aware_elements/type_inference_simple_error_test.dart index 4508247b46f..0a5912eab08 100644 --- a/tests/language/null_aware_elements/type_inference_simple_error_test.dart +++ b/tests/language/null_aware_elements/type_inference_simple_error_test.dart @@ -2,13 +2,11 @@ // 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. -// SharedOptions=--enable-experiment=null-aware-elements - import '../static_type_helper.dart'; String? stringQuestion() => null; -main() { +void main() { [?""]; // Ok. // ^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR diff --git a/tests/language/null_aware_elements/type_inference_simple_positive_test.dart b/tests/language/null_aware_elements/type_inference_simple_positive_test.dart index 795b6991d24..e9bf5b1e39f 100644 --- a/tests/language/null_aware_elements/type_inference_simple_positive_test.dart +++ b/tests/language/null_aware_elements/type_inference_simple_positive_test.dart @@ -2,8 +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. -// SharedOptions=--enable-experiment=null-aware-elements - import '../static_type_helper.dart'; // This is a helper function to suggest to the type inference that the argument diff --git a/tests/language/null_aware_elements/warnings_simple_test.dart b/tests/language/null_aware_elements/warnings_simple_test.dart index 5b4087ceeed..45427264ad7 100644 --- a/tests/language/null_aware_elements/warnings_simple_test.dart +++ b/tests/language/null_aware_elements/warnings_simple_test.dart @@ -2,8 +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. -// SharedOptions=--enable-experiment=null-aware-elements - import 'package:expect/expect.dart'; List testList(int x) { diff --git a/tests/language/sound_flow_analysis/equality_comparisons_test.dart b/tests/language/sound_flow_analysis/equality_comparisons_test.dart index 3734dc5fbde..79d61473601 100644 --- a/tests/language/sound_flow_analysis/equality_comparisons_test.dart +++ b/tests/language/sound_flow_analysis/equality_comparisons_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of equality comparisons (binary expressions using // `==` or `!=`) when `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - import '../static_type_helper.dart'; // ` == ` is known to evaluate to `false`. diff --git a/tests/language/sound_flow_analysis/full_demotion_test.dart b/tests/language/sound_flow_analysis/full_demotion_test.dart index a2e23e1791a..137c5cc42ee 100644 --- a/tests/language/sound_flow_analysis/full_demotion_test.dart +++ b/tests/language/sound_flow_analysis/full_demotion_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of assignments that fully demote the assigned // variable when `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - import '../static_type_helper.dart'; // If an assignment fully demotes a variable, types of interest are not cleared. diff --git a/tests/language/sound_flow_analysis/if_null_test.dart b/tests/language/sound_flow_analysis/if_null_test.dart index 15340552db1..aac9fc77592 100644 --- a/tests/language/sound_flow_analysis/if_null_test.dart +++ b/tests/language/sound_flow_analysis/if_null_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of if-null expressions (expressions involving `??`) // when `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - // ignore_for_file: dead_null_aware_expression import '../static_type_helper.dart'; diff --git a/tests/language/sound_flow_analysis/null_aware_access_test.dart b/tests/language/sound_flow_analysis/null_aware_access_test.dart index 16778d80899..5cce87899dc 100644 --- a/tests/language/sound_flow_analysis/null_aware_access_test.dart +++ b/tests/language/sound_flow_analysis/null_aware_access_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of null aware accesses (expressions involving `?.`) // when `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - // ignore_for_file: invalid_null_aware_operator import '../static_type_helper.dart'; diff --git a/tests/language/sound_flow_analysis/null_aware_field_access_test.dart b/tests/language/sound_flow_analysis/null_aware_field_access_test.dart index 81ea494d567..7a6c63c76a4 100644 --- a/tests/language/sound_flow_analysis/null_aware_field_access_test.dart +++ b/tests/language/sound_flow_analysis/null_aware_field_access_test.dart @@ -9,8 +9,6 @@ // this test reflects the current behavior of the `sound-flow-analysis` feature, // as discussed in https://github.com/dart-lang/language/issues/4344. -// SharedOptions=--enable-experiment=sound-flow-analysis - // ignore_for_file: invalid_null_aware_operator import 'package:expect/static_type_helper.dart'; diff --git a/tests/language/sound_flow_analysis/null_aware_map_entry_test.dart b/tests/language/sound_flow_analysis/null_aware_map_entry_test.dart index 349ce18f9b3..ab1a8619137 100644 --- a/tests/language/sound_flow_analysis/null_aware_map_entry_test.dart +++ b/tests/language/sound_flow_analysis/null_aware_map_entry_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of null-aware map entries when `sound-flow-analysis` // is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - // ignore_for_file: invalid_null_aware_operator import '../static_type_helper.dart'; diff --git a/tests/language/sound_flow_analysis/pattern_matching_non_nullable_test.dart b/tests/language/sound_flow_analysis/pattern_matching_non_nullable_test.dart index 937c526e12f..f5259c5eebe 100644 --- a/tests/language/sound_flow_analysis/pattern_matching_non_nullable_test.dart +++ b/tests/language/sound_flow_analysis/pattern_matching_non_nullable_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of patterns that match a non-nullable scrutinee when // `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - // ignore_for_file: unnecessary_null_check_pattern import '../static_type_helper.dart'; diff --git a/tests/language/sound_flow_analysis/pattern_matching_null_test.dart b/tests/language/sound_flow_analysis/pattern_matching_null_test.dart index 1bb7eb9c791..2b9ca5917f7 100644 --- a/tests/language/sound_flow_analysis/pattern_matching_null_test.dart +++ b/tests/language/sound_flow_analysis/pattern_matching_null_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of patterns that match a Null scrutinee when // `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - import '../static_type_helper.dart'; typedef IntQuestion = int?; diff --git a/tests/language/sound_flow_analysis/pattern_not_matching_non_nullable_test.dart b/tests/language/sound_flow_analysis/pattern_not_matching_non_nullable_test.dart index 730cd8524ae..616dd367f8c 100644 --- a/tests/language/sound_flow_analysis/pattern_not_matching_non_nullable_test.dart +++ b/tests/language/sound_flow_analysis/pattern_not_matching_non_nullable_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of patterns that fail to match a non-nullable // scrutinee when `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - import 'package:expect/expect.dart'; import '../static_type_helper.dart'; diff --git a/tests/language/sound_flow_analysis/pattern_not_matching_null_test.dart b/tests/language/sound_flow_analysis/pattern_not_matching_null_test.dart index 6d6a419df27..583eadc6d96 100644 --- a/tests/language/sound_flow_analysis/pattern_not_matching_null_test.dart +++ b/tests/language/sound_flow_analysis/pattern_not_matching_null_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of patterns that fail to match a Null scrutinee when // `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - import '../static_type_helper.dart'; // ` ` is known to mismatch a null expression. diff --git a/tests/language/sound_flow_analysis/proper_subtypes_test.dart b/tests/language/sound_flow_analysis/proper_subtypes_test.dart index d2a80a09639..5b476a6adbb 100644 --- a/tests/language/sound_flow_analysis/proper_subtypes_test.dart +++ b/tests/language/sound_flow_analysis/proper_subtypes_test.dart @@ -5,8 +5,6 @@ // Checks that when `sound-flow-analysis` is enabled, each type in a promotion // chain is a proper subtype of the previous type (and of the declared type). -// SharedOptions=--enable-experiment=sound-flow-analysis - import '../static_type_helper.dart'; class C { diff --git a/tests/language/sound_flow_analysis/trivially_satisfied_type_check_test.dart b/tests/language/sound_flow_analysis/trivially_satisfied_type_check_test.dart index 768ee8dfd19..71238137d34 100644 --- a/tests/language/sound_flow_analysis/trivially_satisfied_type_check_test.dart +++ b/tests/language/sound_flow_analysis/trivially_satisfied_type_check_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of a trivially satisfied type check (an `is` test // that is guaranteed to succeed) when `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - import '../static_type_helper.dart'; // If `x` is of type `T`, flow analysis considers `x is T` to be guaranteed to diff --git a/tests/language/sound_flow_analysis/try_finally_layering_test.dart b/tests/language/sound_flow_analysis/try_finally_layering_test.dart index 526fbb5ca4d..61b28635a90 100644 --- a/tests/language/sound_flow_analysis/try_finally_layering_test.dart +++ b/tests/language/sound_flow_analysis/try_finally_layering_test.dart @@ -5,8 +5,6 @@ // Tests how flow analysis layers promotions from `try` and `finally` blocks // when `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - import '../static_type_helper.dart'; class C { diff --git a/tests/language/sound_flow_analysis/type_tests_test.dart b/tests/language/sound_flow_analysis/type_tests_test.dart index 76d2240730a..aa4110d7ff0 100644 --- a/tests/language/sound_flow_analysis/type_tests_test.dart +++ b/tests/language/sound_flow_analysis/type_tests_test.dart @@ -5,8 +5,6 @@ // Exercises flow analysis of type tests (`is` and `as` expressions) when // `sound-flow-analysis` is enabled. -// SharedOptions=--enable-experiment=sound-flow-analysis - import 'package:expect/expect.dart'; import '../static_type_helper.dart'; diff --git a/tools/experimental_features.yaml b/tools/experimental_features.yaml index 7ae13e1b728..2143bfb3ce3 100644 --- a/tools/experimental_features.yaml +++ b/tools/experimental_features.yaml @@ -135,11 +135,6 @@ features: experimentalReleaseVersion: '3.3.0' help: "Static meta-programming" - native-assets: - help: "Compile and bundle native assets." - channels: [ "main", "dev", "beta" ] - enabledIn: '3.9.0' - record-use: help: "Output arguments used by static functions." channels: [ "main", "dev" ] @@ -183,6 +178,11 @@ features: } help: "Shorter dot syntax for static accesses." + native-assets: + help: "Compile and bundle native assets." + channels: [ "main", "dev", "beta" ] + enabledIn: '3.9.0' + expired: true getter-setter-error: enabledIn: '3.9.0' @@ -197,6 +197,7 @@ features: print(a.foo); } help: "Stop reporting errors about mismatching types in a getter/setter pair." + expired: true sound-flow-analysis: enabledIn: '3.9.0' @@ -209,6 +210,7 @@ features: } # See https://github.com/dart-lang/language/issues/3100 help: "Assume sound null safety when computing type promotion, reachability, and definite assignment." + expired: true null-aware-elements: enabledIn: '3.8.0' @@ -220,6 +222,7 @@ features: } } help: "Null-aware elements and map entries in collections." + expired: true inference-using-bounds: enabledIn: '3.7.0'