diff --git a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart index 1d182962f7c9..e4c3cc4096c8 100644 --- a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart +++ b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart @@ -21,6 +21,8 @@ final _knownFeatures = { EnableString.extension_methods: ExperimentalFeatures.extension_methods, EnableString.extension_types: ExperimentalFeatures.extension_types, EnableString.generic_metadata: ExperimentalFeatures.generic_metadata, + EnableString.named_arguments_anywhere: + ExperimentalFeatures.named_arguments_anywhere, EnableString.non_nullable: ExperimentalFeatures.non_nullable, EnableString.nonfunction_type_aliases: ExperimentalFeatures.nonfunction_type_aliases, @@ -59,6 +61,9 @@ class EnableString { /// String to enable the experiment "generic-metadata" static const String generic_metadata = 'generic-metadata'; + /// String to enable the experiment "named-arguments-anywhere" + static const String named_arguments_anywhere = 'named-arguments-anywhere'; + /// String to enable the experiment "non-nullable" static const String non_nullable = 'non-nullable'; @@ -168,8 +173,18 @@ class ExperimentalFeatures { releaseVersion: Version.parse('2.14.0'), ); - static final non_nullable = ExperimentalFeature( + static final named_arguments_anywhere = ExperimentalFeature( index: 8, + enableString: EnableString.named_arguments_anywhere, + isEnabledByDefault: IsEnabledByDefault.named_arguments_anywhere, + isExpired: IsExpired.named_arguments_anywhere, + documentation: 'Named Arguments Anywhere', + experimentalReleaseVersion: null, + releaseVersion: null, + ); + + static final non_nullable = ExperimentalFeature( + index: 9, enableString: EnableString.non_nullable, isEnabledByDefault: IsEnabledByDefault.non_nullable, isExpired: IsExpired.non_nullable, @@ -179,7 +194,7 @@ class ExperimentalFeatures { ); static final nonfunction_type_aliases = ExperimentalFeature( - index: 9, + index: 10, enableString: EnableString.nonfunction_type_aliases, isEnabledByDefault: IsEnabledByDefault.nonfunction_type_aliases, isExpired: IsExpired.nonfunction_type_aliases, @@ -189,7 +204,7 @@ class ExperimentalFeatures { ); static final set_literals = ExperimentalFeature( - index: 10, + index: 11, enableString: EnableString.set_literals, isEnabledByDefault: IsEnabledByDefault.set_literals, isExpired: IsExpired.set_literals, @@ -199,7 +214,7 @@ class ExperimentalFeatures { ); static final spread_collections = ExperimentalFeature( - index: 11, + index: 12, enableString: EnableString.spread_collections, isEnabledByDefault: IsEnabledByDefault.spread_collections, isExpired: IsExpired.spread_collections, @@ -209,7 +224,7 @@ class ExperimentalFeatures { ); static final test_experiment = ExperimentalFeature( - index: 12, + index: 13, enableString: EnableString.test_experiment, isEnabledByDefault: IsEnabledByDefault.test_experiment, isExpired: IsExpired.test_experiment, @@ -220,7 +235,7 @@ class ExperimentalFeatures { ); static final triple_shift = ExperimentalFeature( - index: 13, + index: 14, enableString: EnableString.triple_shift, isEnabledByDefault: IsEnabledByDefault.triple_shift, isExpired: IsExpired.triple_shift, @@ -230,7 +245,7 @@ class ExperimentalFeatures { ); static final value_class = ExperimentalFeature( - index: 14, + index: 15, enableString: EnableString.value_class, isEnabledByDefault: IsEnabledByDefault.value_class, isExpired: IsExpired.value_class, @@ -240,7 +255,7 @@ class ExperimentalFeatures { ); static final variance = ExperimentalFeature( - index: 15, + index: 16, enableString: EnableString.variance, isEnabledByDefault: IsEnabledByDefault.variance, isExpired: IsExpired.variance, @@ -277,6 +292,9 @@ class IsEnabledByDefault { /// Default state of the experiment "generic-metadata" static const bool generic_metadata = true; + /// Default state of the experiment "named-arguments-anywhere" + static const bool named_arguments_anywhere = false; + /// Default state of the experiment "non-nullable" static const bool non_nullable = true; @@ -330,6 +348,9 @@ class IsExpired { /// Expiration status of the experiment "generic-metadata" static const bool generic_metadata = false; + /// Expiration status of the experiment "named-arguments-anywhere" + static const bool named_arguments_anywhere = false; + /// Expiration status of the experiment "non-nullable" static const bool non_nullable = false; @@ -384,6 +405,10 @@ mixin _CurrentState { /// Current state for the flag "generic-metadata" bool get generic_metadata => isEnabled(ExperimentalFeatures.generic_metadata); + /// Current state for the flag "named-arguments-anywhere" + bool get named_arguments_anywhere => + isEnabled(ExperimentalFeatures.named_arguments_anywhere); + /// Current state for the flag "non-nullable" bool get non_nullable => isEnabled(ExperimentalFeatures.non_nullable); 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 0d5e338b0e2f..82414c97ec63 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 @@ -19,6 +19,7 @@ enum ExperimentalFlag { extensionMethods, extensionTypes, genericMetadata, + namedArgumentsAnywhere, nonNullable, nonfunctionTypeAliases, setLiterals, @@ -39,6 +40,7 @@ const Version enableEnhancedEnumsVersion = const Version(2, 15); const Version enableExtensionMethodsVersion = const Version(2, 6); const Version enableExtensionTypesVersion = const Version(2, 15); const Version enableGenericMetadataVersion = const Version(2, 14); +const Version enableNamedArgumentsAnywhereVersion = const Version(2, 15); const Version enableNonNullableVersion = const Version(2, 12); const Version enableNonfunctionTypeAliasesVersion = const Version(2, 13); const Version enableSetLiteralsVersion = const Version(2, 0); @@ -68,6 +70,8 @@ ExperimentalFlag? parseExperimentalFlag(String flag) { return ExperimentalFlag.extensionTypes; case "generic-metadata": return ExperimentalFlag.genericMetadata; + case "named-arguments-anywhere": + return ExperimentalFlag.namedArgumentsAnywhere; case "non-nullable": return ExperimentalFlag.nonNullable; case "nonfunction-type-aliases": @@ -98,6 +102,7 @@ const Map defaultExperimentalFlags = { ExperimentalFlag.extensionMethods: true, ExperimentalFlag.extensionTypes: false, ExperimentalFlag.genericMetadata: true, + ExperimentalFlag.namedArgumentsAnywhere: false, ExperimentalFlag.nonNullable: true, ExperimentalFlag.nonfunctionTypeAliases: true, ExperimentalFlag.setLiterals: true, @@ -118,6 +123,7 @@ const Map expiredExperimentalFlags = { ExperimentalFlag.extensionMethods: false, ExperimentalFlag.extensionTypes: false, ExperimentalFlag.genericMetadata: false, + ExperimentalFlag.namedArgumentsAnywhere: false, ExperimentalFlag.nonNullable: false, ExperimentalFlag.nonfunctionTypeAliases: false, ExperimentalFlag.setLiterals: true, @@ -138,6 +144,7 @@ const Map experimentEnabledVersion = { ExperimentalFlag.extensionMethods: const Version(2, 6), ExperimentalFlag.extensionTypes: const Version(2, 15), ExperimentalFlag.genericMetadata: const Version(2, 14), + ExperimentalFlag.namedArgumentsAnywhere: const Version(2, 15), ExperimentalFlag.nonNullable: const Version(2, 12), ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 13), ExperimentalFlag.setLiterals: const Version(2, 0), @@ -158,6 +165,7 @@ const Map experimentReleasedVersion = { ExperimentalFlag.extensionMethods: const Version(2, 6), ExperimentalFlag.extensionTypes: const Version(2, 15), ExperimentalFlag.genericMetadata: const Version(2, 14), + ExperimentalFlag.namedArgumentsAnywhere: const Version(2, 15), ExperimentalFlag.nonNullable: const Version(2, 10), ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 13), ExperimentalFlag.setLiterals: const Version(2, 0), diff --git a/tools/experimental_features.yaml b/tools/experimental_features.yaml index 8837f995f98e..bf28d5680f9e 100644 --- a/tools/experimental_features.yaml +++ b/tools/experimental_features.yaml @@ -125,6 +125,9 @@ features: enhanced-enums: help: "Enhanced Enums" + named-arguments-anywhere: + help: "Named Arguments Anywhere" + # Experiment flag only used for testing. test-experiment: help: >-