1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 12:06:26 +00:00

Reland "Expire 3.0.0 experiment flags."

This is a reland of commit 6f29e7fce4

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

TEST=Existing tests covers.
Change-Id: I384e77744c74774a250be413358a7fa176117167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332684
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
This commit is contained in:
Lasse R.H. Nielsen 2023-11-17 13:10:01 +00:00 committed by Commit Queue
parent cc161c4e5c
commit 5543293a16
27 changed files with 38 additions and 840 deletions

View File

@ -13,7 +13,7 @@ enum ExperimentalFlag {
classModifiers(
name: 'class-modifiers',
isEnabledByDefault: true,
isExpired: false,
isExpired: true,
experimentEnabledVersion: const Version(3, 0),
experimentReleasedVersion: const Version(3, 0)),
@ -125,21 +125,21 @@ enum ExperimentalFlag {
patterns(
name: 'patterns',
isEnabledByDefault: true,
isExpired: false,
isExpired: true,
experimentEnabledVersion: const Version(3, 0),
experimentReleasedVersion: const Version(3, 0)),
records(
name: 'records',
isEnabledByDefault: true,
isExpired: false,
isExpired: true,
experimentEnabledVersion: const Version(3, 0),
experimentReleasedVersion: const Version(3, 0)),
sealedClass(
name: 'sealed-class',
isEnabledByDefault: true,
isExpired: false,
isExpired: true,
experimentEnabledVersion: const Version(3, 0),
experimentReleasedVersion: const Version(3, 0)),

View File

@ -19,7 +19,7 @@ void main() {
@reflectiveTest
class RemoveBreakBulkTest extends BulkFixProcessorTest {
@override
List<String> get experiments => ['patterns', 'records'];
List<String> get experiments => [];
@override
String get lintCode => LintNames.unnecessary_breaks;
@ -76,7 +76,7 @@ void f() {
@reflectiveTest
class RemoveBreakTest extends FixProcessorLintTest {
@override
List<String> get experiments => ['patterns', 'records'];
List<String> get experiments => [];
@override
FixKind get kind => DartFixKind.REMOVE_BREAK;

View File

@ -483,7 +483,7 @@ class IsEnabledByDefault {
/// value in [IsEnabledByDefault]).
class IsExpired {
/// Expiration status of the experiment "class-modifiers"
static const bool class_modifiers = false;
static const bool class_modifiers = true;
/// Expiration status of the experiment "const-functions"
static const bool const_functions = false;
@ -531,13 +531,13 @@ class IsExpired {
static const bool nonfunction_type_aliases = true;
/// Expiration status of the experiment "patterns"
static const bool patterns = false;
static const bool patterns = true;
/// Expiration status of the experiment "records"
static const bool records = false;
static const bool records = true;
/// Expiration status of the experiment "sealed-class"
static const bool sealed_class = false;
static const bool sealed_class = true;
/// Expiration status of the experiment "set-literals"
static const bool set_literals = true;

View File

@ -32,7 +32,7 @@ main() {
}
""",
testBackendWorld: true,
options: ['--enable-experiment=records', Flags.soundNullSafety]);
options: [Flags.soundNullSafety]);
JClosedWorld world = env.jClosedWorld;
final domain = world.abstractValueDomain as CommonMasks;

View File

@ -448,7 +448,7 @@ analyzer:
expect(result.exitCode, 0);
expect(result.stdout, contains('No issues found!'));
expect(result.stderr, contains("'records' is now enabled by default"));
});
}, skip: 'records are enabled by default in 3.0');
test('--verbose', () async {
p = project(mainSrc: '''

View File

@ -252,8 +252,6 @@ void main(List<String> args) {
final stop = await client.hitBreakpoint(
testFile,
breakpointLine,
// TODO(dantup): Remove toolArgs when this is no longer required.
toolArgs: ['--enable-experiment=records'],
);
// Check the fields directly on the record.

View File

@ -62,7 +62,7 @@ class ExperimentalFlag {
static const ExperimentalFlag classModifiers = const ExperimentalFlag(
name: 'class-modifiers',
isEnabledByDefault: true,
isExpired: false,
isExpired: true,
enabledVersion: const Version(3, 0),
experimentEnabledVersion: const Version(3, 0),
experimentReleasedVersion: const Version(3, 0));
@ -190,7 +190,7 @@ class ExperimentalFlag {
static const ExperimentalFlag patterns = const ExperimentalFlag(
name: 'patterns',
isEnabledByDefault: true,
isExpired: false,
isExpired: true,
enabledVersion: const Version(3, 0),
experimentEnabledVersion: const Version(3, 0),
experimentReleasedVersion: const Version(3, 0));
@ -198,7 +198,7 @@ class ExperimentalFlag {
static const ExperimentalFlag records = const ExperimentalFlag(
name: 'records',
isEnabledByDefault: true,
isExpired: false,
isExpired: true,
enabledVersion: const Version(3, 0),
experimentEnabledVersion: const Version(3, 0),
experimentReleasedVersion: const Version(3, 0));
@ -206,7 +206,7 @@ class ExperimentalFlag {
static const ExperimentalFlag sealedClass = const ExperimentalFlag(
name: 'sealed-class',
isEnabledByDefault: true,
isExpired: false,
isExpired: true,
enabledVersion: const Version(3, 0),
experimentEnabledVersion: const Version(3, 0),
experimentReleasedVersion: const Version(3, 0));
@ -747,199 +747,18 @@ final Map<ExperimentalFlag, bool> defaultExperimentalFlags = {
ExperimentalFlag.variance: ExperimentalFlag.variance.isEnabledByDefault,
};
const AllowedExperimentalFlags defaultAllowedExperimentalFlags =
const AllowedExperimentalFlags(sdkDefaultExperiments: {
ExperimentalFlag.records,
ExperimentalFlag.classModifiers,
ExperimentalFlag.sealedClass,
}, sdkLibraryExperiments: {
"js_interop": {
ExperimentalFlag.inlineClass,
},
}, packageExperiments: {
"async": {
ExperimentalFlag.nonNullable,
},
"boolean_selector": {
ExperimentalFlag.nonNullable,
},
"characters": {
ExperimentalFlag.nonNullable,
},
"clock": {
ExperimentalFlag.nonNullable,
},
"collection": {
ExperimentalFlag.nonNullable,
},
"connectivity": {
ExperimentalFlag.nonNullable,
},
"connectivity_platform_interface": {
ExperimentalFlag.nonNullable,
},
"convert": {
ExperimentalFlag.nonNullable,
},
"crypto": {
ExperimentalFlag.nonNullable,
},
"csslib": {
ExperimentalFlag.nonNullable,
},
"dart_internal": {
ExperimentalFlag.nonNullable,
},
"device_info": {
ExperimentalFlag.nonNullable,
},
"device_info_platform_interface": {
ExperimentalFlag.nonNullable,
},
"fake_async": {
ExperimentalFlag.nonNullable,
},
"file": {
ExperimentalFlag.nonNullable,
},
"fixnum": {
ExperimentalFlag.nonNullable,
},
"flutter": {
ExperimentalFlag.nonNullable,
},
"flutter_driver": {
ExperimentalFlag.nonNullable,
},
"flutter_test": {
ExperimentalFlag.nonNullable,
},
"flutter_goldens": {
ExperimentalFlag.nonNullable,
},
"flutter_goldens_client": {
ExperimentalFlag.nonNullable,
},
"http": {
ExperimentalFlag.nonNullable,
},
"http_parser": {
ExperimentalFlag.nonNullable,
},
"intl": {
ExperimentalFlag.nonNullable,
},
"js": {
ExperimentalFlag.nonNullable,
},
"logging": {
ExperimentalFlag.nonNullable,
},
"matcher": {
ExperimentalFlag.nonNullable,
},
"meta": {
ExperimentalFlag.nonNullable,
},
"native_assets_builder": {
ExperimentalFlag.nonNullable,
},
"native_stack_traces": {
ExperimentalFlag.nonNullable,
},
"observatory": {
ExperimentalFlag.nonNullable,
},
"observatory_test_package": {
ExperimentalFlag.nonNullable,
},
"path": {
ExperimentalFlag.nonNullable,
},
"pedantic": {
ExperimentalFlag.nonNullable,
},
"platform": {
ExperimentalFlag.nonNullable,
},
"plugin_platform_interface": {
ExperimentalFlag.nonNullable,
},
"pool": {
ExperimentalFlag.nonNullable,
},
"process": {
ExperimentalFlag.nonNullable,
},
"pub_semver": {
ExperimentalFlag.nonNullable,
},
"sky_engine": {
ExperimentalFlag.nonNullable,
},
"source_maps": {
ExperimentalFlag.nonNullable,
},
"source_map_stack_trace": {
ExperimentalFlag.nonNullable,
},
"source_span": {
ExperimentalFlag.nonNullable,
},
"stack_trace": {
ExperimentalFlag.nonNullable,
},
"stream_channel": {
ExperimentalFlag.nonNullable,
},
"string_scanner": {
ExperimentalFlag.nonNullable,
},
"term_glyph": {
ExperimentalFlag.nonNullable,
},
"test": {
ExperimentalFlag.nonNullable,
},
"test_api": {
ExperimentalFlag.nonNullable,
},
"test_core": {
ExperimentalFlag.nonNullable,
},
"typed_data": {
ExperimentalFlag.nonNullable,
},
"url_launcher": {
ExperimentalFlag.nonNullable,
},
"url_launcher_linux": {
ExperimentalFlag.nonNullable,
},
"url_launcher_macos": {
ExperimentalFlag.nonNullable,
},
"url_launcher_platform_interface": {
ExperimentalFlag.nonNullable,
},
"url_launcher_windows": {
ExperimentalFlag.nonNullable,
},
"vector_math": {
ExperimentalFlag.nonNullable,
},
"video_player": {
ExperimentalFlag.nonNullable,
},
"video_player_platform_interface": {
ExperimentalFlag.nonNullable,
},
"video_player_web": {
ExperimentalFlag.nonNullable,
},
"web": {
ExperimentalFlag.inlineClass,
},
});
const AllowedExperimentalFlags(
sdkDefaultExperiments: {},
sdkLibraryExperiments: {
"js_interop": {
ExperimentalFlag.inlineClass,
},
},
packageExperiments: {
"web": {
ExperimentalFlag.inlineClass,
},
});
const Map<shared.ExperimentalFlag, ExperimentalFlag> sharedExperimentalFlags = {
shared.ExperimentalFlag.classModifiers: ExperimentalFlag.classModifiers,
shared.ExperimentalFlag.constFunctions: ExperimentalFlag.constFunctions,

View File

@ -381,7 +381,6 @@ RecordLiteralOnePositionalFieldNoTrailingComma:
```dart
var r = const (1,);
```
experiments: records
script: >
main() {
var record = const (1);
@ -422,7 +421,6 @@ RecordLiteralZeroFieldsWithTrailingComma:
```dart
var r = (3, 4);
```
experiments: records
script: >
main() {
var record = (,);
@ -464,7 +462,6 @@ EmptyRecordTypeNamedFieldsList:
```dart
void f((int, int) r) {}
```
experiments: records
script: >
main() {
(int, int, {/*missing*/}) record = (1, 2,);
@ -505,7 +502,6 @@ RecordTypeZeroFieldsButTrailingComma:
```dart
void f((int, int) r) {}
```
experiments: records
script: >
main() {
(,) record = ();
@ -543,7 +539,6 @@ RecordTypeOnePositionalFieldNoTrailingComma:
```dart
void f((int,) r) {}
```
experiments: records
script: >
main() {
(int /* missing trailing comma */) record = const (1, );
@ -552,7 +547,6 @@ RecordTypeOnePositionalFieldNoTrailingComma:
DuplicatedRecordTypeFieldName:
problemMessage: "Duplicated record type field name '#name'."
correctionMessage: "Try renaming or removing one of the named record type fields."
experiments: records
script: |
({int a, String a}) record = throw '';
@ -563,7 +557,6 @@ DuplicatedRecordTypeFieldNameContext:
DuplicatedRecordLiteralFieldName:
problemMessage: "Duplicated record literal field name '#name'."
correctionMessage: "Try renaming or removing one of the named record literal fields."
experiments: records
script: |
dynamic field = (a: 0, a: 1);
@ -750,7 +743,6 @@ MultipleImplements:
MultipleClauses:
problemMessage: "Each '#string' definition can have at most one '#string2' clause."
correctionMessage: "Try combining all of the '#string2' clauses into a single clause."
experiments: enhanced-enums
analyzerCode: ParserErrorCode.MULTIPLE_CLAUSES
index: 121
script:
@ -760,7 +752,6 @@ MultipleClauses:
OutOfOrderClauses:
problemMessage: "The '#string' clause must come before the '#string2' clause."
correctionMessage: "Try moving the '#string' clause before the '#string2' clause."
experiments: enhanced-enums
analyzerCode: ParserErrorCode.OUT_OF_ORDER_CLAUSES
index: 122
script: "class B {} class D {} enum A implements B with D { v; }"
@ -1086,7 +1077,6 @@ AbstractSealedClass:
```dart
sealed class C {}
```
experiments: sealed-class
script:
- "sealed abstract class C {}"
- "abstract sealed class C {}"
@ -3612,7 +3602,6 @@ SupertypeIsIllegalAliased:
SupertypeIsNullableAliased:
problemMessage: "The type '#name' which is an alias of '#type' can't be used as supertype because it is nullable."
analyzerCode: EXTENDS_NON_CLASS
experiments: nonfunction-type-aliases
script: |
class A {}
typedef B = A?;
@ -4897,7 +4886,6 @@ IncorrectTypeArgumentInstantiation:
problemMessage: "Type argument '#type' doesn't conform to the bound '#type2' of the type variable '#name' on '#type3'."
correctionMessage: "Try changing type arguments so that they conform to the bounds."
analyzerCode: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
experiments: constructor-tearoffs
script: |
X bounded<X extends num>(X x) => x;
main() {
@ -6134,7 +6122,6 @@ UnsupportedDartExt:
InstantiationNonGenericFunctionType:
problemMessage: "The static type of the explicit instantiation operand must be a generic function type but is '#type'."
correctionMessage: "Try changing the operand or remove the type arguments."
experiments: constructor-tearoffs
script: |
f() {}
main() => f<int>;
@ -6143,14 +6130,12 @@ InstantiationNullableGenericFunctionType:
problemMessage: "The static type of the explicit instantiation operand must be a non-null generic function type but is '#type'."
correctionMessage: "Try changing the operand or remove the type arguments."
analyzerCode: DISALLOWED_TYPE_INSTANTIATION_EXPRESSION
experiments: constructor-tearoffs
script: |
test(void Function<T>()? f) => f<int>;
InstantiationTooFewArguments:
problemMessage: "Too few type arguments: #count required, #count2 given."
correctionMessage: "Try adding the missing type arguments."
experiments: constructor-tearoffs
script: |
f<X, Y>() {}
main() => f<int>;
@ -6158,14 +6143,12 @@ InstantiationTooFewArguments:
InstantiationTooManyArguments:
problemMessage: "Too many type arguments: #count allowed, but #count2 found."
correctionMessage: "Try removing the extra type arguments."
experiments: constructor-tearoffs
script: |
f<X>() {}
main() => f<int, String>;
AbstractClassConstructorTearOff:
problemMessage: "Constructors on abstract classes can't be torn off."
experiments: constructor-tearoffs
script: |
abstract class Class {}
main() => Class.new;
@ -6173,7 +6156,6 @@ AbstractClassConstructorTearOff:
StaticTearOffFromInstantiatedClass:
problemMessage: "Cannot access static member on an instantiated generic class."
correctionMessage: "Try removing the type arguments or placing them after the member name."
experiments: constructor-tearoffs
script: |
class A<X> { static f() {} }
main() => A<int>.f;
@ -6182,13 +6164,11 @@ StaticTearOffFromInstantiatedClass:
ConstructorTearOffWithTypeArguments:
problemMessage: "A constructor tear-off can't have type arguments after the constructor name."
correctionMessage: "Try removing the type arguments or placing them after the class name."
experiments: constructor-tearoffs
script:
- "class C<X> { C.foo(); } bar() { C.foo<int>; }"
NewAsSelector:
problemMessage: "'new' can only be used as a constructor reference."
experiments: constructor-tearoffs
script: |
method(dynamic d) => d.new;
@ -6525,14 +6505,12 @@ ObjectMemberNameUsedForRecordField:
RecordFieldsCantBePrivate:
problemMessage: "Record field names can't be private."
analyzerCode: INVALID_FIELD_NAME
experiments: records
script: |
foo() => (_bar: 1);
NamedFieldClashesWithPositionalFieldInRecord:
problemMessage: "Record field names can't be a dollar sign followed by an integer when integer is the index of a positional field."
analyzerCode: INVALID_FIELD_NAME
experiments: records
script: |
foo() => (0, $1: 0);
@ -6550,7 +6528,6 @@ InheritedRestrictedMemberOfEnumImplementer:
SealedClassSubtypeOutsideOfLibrary:
problemMessage: "The class '#name' can't be extended, implemented, or mixed in outside of its library because it's a sealed class."
analyzerCode: SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY
experiments: sealed-class
script:
main.dart:
import 'lib.dart';
@ -6561,7 +6538,6 @@ SealedClassSubtypeOutsideOfLibrary:
CantUseClassAsMixin:
problemMessage: "The class '#name' can't be used as a mixin because it isn't a mixin class nor a mixin."
analyzerCode: CLASS_USED_AS_MIXIN
experiments: class-modifiers
script:
main.dart:
import 'lib.dart';
@ -6574,7 +6550,6 @@ BaseEnum:
problemMessage: "Enums can't be declared to be 'base'."
correctionMessage: "Try removing the keyword 'base'."
analyzerCode: ParserErrorCode.BASE_ENUM
experiments: class-modifiers
script:
- "base enum E { v }"
@ -6583,7 +6558,6 @@ FinalEnum:
problemMessage: "Enums can't be declared to be 'final'."
correctionMessage: "Try removing the keyword 'final'."
analyzerCode: ParserErrorCode.FINAL_ENUM
experiments: class-modifiers
script:
- "final enum E { v }"
@ -6592,7 +6566,6 @@ InterfaceEnum:
problemMessage: "Enums can't be declared to be 'interface'."
correctionMessage: "Try removing the keyword 'interface'."
analyzerCode: ParserErrorCode.INTERFACE_ENUM
experiments: class-modifiers
script:
- "interface enum E { v }"
@ -6601,7 +6574,6 @@ SealedEnum:
problemMessage: "Enums can't be declared to be 'sealed'."
correctionMessage: "Try removing the keyword 'sealed'."
analyzerCode: ParserErrorCode.SEALED_ENUM
experiments: class-modifiers,sealed-class
script:
- "sealed enum E { v }"
@ -6610,7 +6582,6 @@ FinalMixin:
problemMessage: "A mixin can't be declared 'final'."
correctionMessage: "Try removing the 'final' keyword."
analyzerCode: ParserErrorCode.FINAL_MIXIN
experiments: class-modifiers
script:
- "final mixin M {}"
@ -6619,7 +6590,6 @@ InterfaceMixin:
problemMessage: "A mixin can't be declared 'interface'."
correctionMessage: "Try removing the 'interface' keyword."
analyzerCode: ParserErrorCode.INTERFACE_MIXIN
experiments: class-modifiers
script:
- "interface mixin M {}"
@ -6628,7 +6598,6 @@ SealedMixin:
problemMessage: "A mixin can't be declared 'sealed'."
correctionMessage: "Try removing the 'sealed' keyword."
analyzerCode: ParserErrorCode.SEALED_MIXIN
experiments: class-modifiers,sealed-class
script:
- "sealed mixin M {}"
@ -6637,7 +6606,6 @@ FinalMixinClass:
problemMessage: "A mixin class can't be declared 'final'."
correctionMessage: "Try removing the 'final' keyword."
analyzerCode: ParserErrorCode.FINAL_MIXIN_CLASS
experiments: class-modifiers
script:
- "final mixin class C {}"
@ -6646,7 +6614,6 @@ InterfaceMixinClass:
problemMessage: "A mixin class can't be declared 'interface'."
correctionMessage: "Try removing the 'interface' keyword."
analyzerCode: ParserErrorCode.INTERFACE_MIXIN_CLASS
experiments: class-modifiers
script:
- "interface mixin class C {}"
@ -6655,14 +6622,12 @@ SealedMixinClass:
problemMessage: "A mixin class can't be declared 'sealed'."
correctionMessage: "Try removing the 'sealed' keyword."
analyzerCode: ParserErrorCode.SEALED_MIXIN_CLASS
experiments: class-modifiers,sealed-class
script:
- "sealed mixin class C {}"
BaseClassImplementedOutsideOfLibrary:
problemMessage: "The class '#name' can't be implemented outside of its library because it's a base class."
analyzerCode: BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY
experiments: class-modifiers
script:
main.dart:
import 'lib.dart';
@ -6677,7 +6642,6 @@ BaseOrFinalClassImplementedOutsideOfLibraryCause:
BaseMixinImplementedOutsideOfLibrary:
problemMessage: "The mixin '#name' can't be implemented outside of its library because it's a base mixin."
analyzerCode: BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY
experiments: class-modifiers
script:
main.dart:
import 'lib.dart';
@ -6688,7 +6652,6 @@ BaseMixinImplementedOutsideOfLibrary:
InterfaceClassExtendedOutsideOfLibrary:
problemMessage: "The class '#name' can't be extended outside of its library because it's an interface class."
analyzerCode: INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY
experiments: class-modifiers
script:
main.dart:
import 'lib.dart';
@ -6699,7 +6662,6 @@ InterfaceClassExtendedOutsideOfLibrary:
FinalClassExtendedOutsideOfLibrary:
problemMessage: "The class '#name' can't be extended outside of its library because it's a final class."
analyzerCode: FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY
experiments: class-modifiers
script:
main.dart:
import 'lib.dart';
@ -6710,7 +6672,6 @@ FinalClassExtendedOutsideOfLibrary:
FinalClassImplementedOutsideOfLibrary:
problemMessage: "The class '#name' can't be implemented outside of its library because it's a final class."
analyzerCode: FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY
experiments: class-modifiers
script:
main.dart:
import 'lib.dart';
@ -6721,7 +6682,6 @@ FinalClassImplementedOutsideOfLibrary:
FinalClassUsedAsMixinConstraintOutsideOfLibrary:
problemMessage: "The class '#name' can't be used as a mixin superclass constraint outside of its library because it's a final class."
analyzerCode: FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY
experiments: class-modifiers
script:
main.dart:
import 'lib.dart';
@ -6733,7 +6693,6 @@ SubtypeOfBaseIsNotBaseFinalOrSealed:
problemMessage: "The type '#name' must be 'base', 'final' or 'sealed' because the supertype '#name2' is 'base'."
correctionMessage: "Try adding 'base', 'final', or 'sealed' to the type."
analyzerCode: SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED
experiments: class-modifiers,sealed-class
script: |
base class A {}
class B extends A {}
@ -6742,7 +6701,6 @@ SubtypeOfFinalIsNotBaseFinalOrSealed:
problemMessage: "The type '#name' must be 'base', 'final' or 'sealed' because the supertype '#name2' is 'final'."
correctionMessage: "Try adding 'base', 'final', or 'sealed' to the type."
analyzerCode: SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
experiments: class-modifiers,sealed-class
script: |
final class A {}
class B extends A {}
@ -6751,7 +6709,6 @@ MixinSubtypeOfBaseIsNotBase:
problemMessage: "The mixin '#name' must be 'base' because the supertype '#name2' is 'base'."
correctionMessage: "Try adding 'base' to the mixin."
analyzerCode: MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE
experiments: class-modifiers,sealed-class
script: |
base class A {}
mixin B implements A {}
@ -6760,14 +6717,12 @@ MixinSubtypeOfFinalIsNotBase:
problemMessage: "The mixin '#name' must be 'base' because the supertype '#name2' is 'final'."
correctionMessage: "Try adding 'base' to the mixin."
analyzerCode: MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE
experiments: class-modifiers,sealed-class
script: |
final class A {}
mixin B implements A {}
UnspecifiedGetterNameInObjectPattern:
problemMessage: "The getter name is not specified explicitly, and the pattern is not a variable. Try specifying the getter name explicitly, or using a variable pattern."
experiments: patterns
analyzerCode: MISSING_OBJECT_PATTERN_GETTER_NAME
script: |
abstract class A { int get foo;}
@ -6775,7 +6730,6 @@ UnspecifiedGetterNameInObjectPattern:
JointPatternVariablesMismatch:
problemMessage: "Variable pattern '#name' doesn't have the same type or finality in all cases."
experiments: patterns
script: |
test(dynamic x) { switch (x) { case [int a]: case [double a] : return a; default: return null; } }
@ -6783,7 +6737,6 @@ NonExhaustiveSwitchExpression:
problemMessage: "The type '#type' is not exhaustively matched by the switch cases since it doesn't match '#string'."
correctionMessage: "Try adding a wildcard pattern or cases that match '#string2'."
analyzerCode: NON_EXHAUSTIVE_SWITCH_EXPRESSION
experiments: patterns
script: |
enum Enum { a, b }
String method(Enum e) => switch (e) {
@ -6794,7 +6747,6 @@ NonExhaustiveSwitchStatement:
problemMessage: "The type '#type' is not exhaustively matched by the switch cases since it doesn't match '#string'."
correctionMessage: "Try adding a default case or cases that match '#string2'."
analyzerCode: NON_EXHAUSTIVE_SWITCH_STATEMENT
experiments: patterns
script: |
enum Enum { a, b }
method(Enum e) {
@ -6808,7 +6760,6 @@ UnreachableSwitchCase:
problemMessage: "This case is covered by the previous cases."
analyzerCode: UNREACHABLE_SWITCH_CASE
severity: WARNING # TODO(johnniwinther): Should this be an error, warning or not emitted at all?
experiments: patterns
script: |
enum Enum { a, b }
method(Enum e) {
@ -6826,7 +6777,6 @@ PatternTypeMismatchInIrrefutableContext:
problemMessage: "The matched value of type '#type' isn't assignable to the required type '#type2'."
correctionMessage: "Try changing the required type of the pattern, or the matched value type."
analyzerCode: PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT
experiments: patterns
script: |
method(List<String> list) {
var <int>[a] = list;
@ -6836,7 +6786,6 @@ DuplicatePatternAssignmentVariable:
problemMessage: The variable '#name' is already assigned in this pattern.
correctionMessage: Try renaming the variable.
analyzerCode: DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE
experiments: patterns
script: |
method(List<String> list) {
String a = '';
@ -6851,7 +6800,6 @@ DuplicateRecordPatternField:
problemMessage: The field '#name' is already matched in this pattern.
correctionMessage: Try removing the duplicate field.
analyzerCode: DUPLICATE_RECORD_PATTERN_FIELD
experiments: patterns
script: |
method(o) {
switch (o) {
@ -6867,7 +6815,6 @@ DuplicateRestElementInPattern:
problemMessage: At most one rest element is allowed in a list or map pattern.
correctionMessage: Try removing the duplicate rest element.
analyzerCode: DUPLICATE_REST_ELEMENT_IN_PATTERN
experiments: patterns
script: |
method(o) {
switch (o) {
@ -6881,7 +6828,6 @@ DuplicateRestElementInPatternContext:
RestPatternInMapPattern:
problemMessage: "The '...' pattern can't appear in map patterns."
experiments: patterns
script: |
test(dynamic x) { if (x case {1: 1, ...}) {} }
@ -6890,7 +6836,6 @@ UnnecessaryNullAssertPattern:
correctionMessage: Try replacing the null-assert pattern with its nested pattern.
analyzerCode: UNNECESSARY_NULL_ASSERT_PATTERN
severity: WARNING
experiments: patterns
script: |
method(List<int> list) {
if (list case [var a!]) {}
@ -6902,7 +6847,6 @@ UnnecessaryNullCheckPattern:
analyzerCode: UNNECESSARY_NULL_CHECK_PATTERN
comment: No parameters.
severity: WARNING
experiments: patterns
script: |
method(List<int> list) {
if (list case [var a?]) {}
@ -6912,7 +6856,6 @@ NonBoolCondition:
problemMessage: "Conditions must have a static type of 'bool'."
correctionMessage: Try changing the condition.
analyzerCode: NON_BOOL_CONDITION
experiments: patterns
script: |
method(int i) {
if (i case 5 when i) {}
@ -6922,7 +6865,6 @@ RefutablePatternInIrrefutableContext:
problemMessage: Refutable patterns can't be used in an irrefutable context.
correctionMessage: Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
analyzerCode: REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT
experiments: patterns
script: |
method(int? x) {
var (a?) = x;
@ -6932,7 +6874,6 @@ MissingVariablePattern:
problemMessage: "Variable pattern '#name' is missing in this branch of the logical-or pattern."
correctionMessage: "Try declaring this variable pattern in the branch."
analyzerCode: MISSING_VARIABLE_PATTERN
experiments: patterns
script: |
method(x) {
if (x case [var a] || _) {}
@ -6941,7 +6882,6 @@ MissingVariablePattern:
MapPatternTypeArgumentMismatch:
problemMessage: "A map pattern requires exactly two type arguments."
analyzerCode: EXPECTED_TWO_MAP_PATTERN_TYPE_ARGUMENTS
experiments: patterns
script: |
method(x) {
if (x case <int>{0: 0}) {}
@ -6950,7 +6890,6 @@ MapPatternTypeArgumentMismatch:
ListPatternTooManyTypeArguments:
problemMessage: "A list pattern requires exactly one type argument."
analyzerCode: EXPECTED_ONE_LIST_PATTERN_TYPE_ARGUMENTS
experiments: patterns
script: |
method(x) {
if (x case <int, int>[]) {}
@ -6959,7 +6898,6 @@ ListPatternTooManyTypeArguments:
UnnamedObjectPatternField:
problemMessage: "A pattern field in an object pattern must be named."
correctionMessage: "Try adding a pattern name or ':' before the pattern."
experiments: patterns
script: |
method(x) {
if (x case int(5)) {}
@ -6968,7 +6906,6 @@ UnnamedObjectPatternField:
InvalidConstantPatternNegation:
problemMessage: "Only negation of a numeric literal is supported as a constant pattern."
correctionMessage: "Try wrapping the expression in 'const ( ... )'."
experiments: patterns
analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_NEGATION
index: 135
script: |
@ -6980,7 +6917,6 @@ InvalidConstantPatternNegation:
InvalidConstantPatternUnary:
problemMessage: "The unary operator #name is not supported as a constant pattern."
correctionMessage: "Try wrapping the expression in 'const ( ... )'."
experiments: patterns
analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_UNARY
index: 136
script: |
@ -6994,7 +6930,6 @@ InvalidConstantPatternDuplicateConst:
correctionMessage: "Try removing one of the 'const' keywords."
analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_DUPLICATE_CONST
index: 137
experiments: patterns
script: |
method(x) {
if (x case const const []) {}
@ -7004,7 +6939,6 @@ InvalidConstantPatternEmptyRecordLiteral:
problemMessage: "The empty record literal is not supported as a constant pattern."
analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_EMPTY_RECORD_LITERAL
index: 138
experiments: patterns,records
script: |
method(x) {
if (x case const ()) {}
@ -7015,7 +6949,6 @@ InvalidConstantPatternGeneric:
correctionMessage: "Try wrapping the expression in 'const ( ... )'."
analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_GENERIC
index: 139
experiments: patterns
script: |
method(x) {
if (x case List<int>) {}
@ -7026,7 +6959,6 @@ InvalidConstantPatternConstPrefix:
correctionMessage: "Try wrapping the expression in 'const ( ... )' instead."
analyzerCode: ParserErrorCode.INVALID_CONSTANT_CONST_PREFIX
index: 140
experiments: patterns
script: |
method(x) {
if (x case const 1) {}
@ -7037,7 +6969,6 @@ InvalidConstantPatternBinary:
correctionMessage: "Try wrapping the expression in 'const ( ... )'."
analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY
index: 141
experiments: patterns
script: |
method(x) {
if (x case 1 + 2) {}
@ -7048,7 +6979,6 @@ PatternAssignmentDeclaresVariable:
correctionMessage: "Try using a preexisting variable or changing the assignment to a pattern variable declaration."
analyzerCode: ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE
index: 145
experiments: patterns
script: |
method(x) {
var y;
@ -7059,7 +6989,6 @@ PatternAssignmentNotLocalVariable:
problemMessage: Only local variables or formal parameters can be used in pattern assignments.
correctionMessage: Try assigning to a local variable.
analyzerCode: PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE
experiments: patterns
script: |
var global;
method(x) {
@ -7071,7 +7000,6 @@ VariablePatternKeywordInDeclarationContext:
correctionMessage: Try removing the keyword.
analyzerCode: ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT
index: 149
experiments: patterns
comment: No parameters.
hasPublishedDocs: true
script: |
@ -7113,7 +7041,6 @@ IllegalPatternVariableName:
correctionMessage: Choose a different name.
analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_VARIABLE_NAME
index: 159
experiments: patterns
comment: |-
Parameters:
0: the illegal name
@ -7129,7 +7056,6 @@ IllegalPatternAssignmentVariableName:
correctionMessage: Choose a different name.
analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME
index: 160
experiments: patterns
comment: |-
Parameters:
0: the illegal name
@ -7144,7 +7070,6 @@ IllegalPatternIdentifierName:
correctionMessage: Match the identifier using '== #lexeme'.
analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_IDENTIFIER_NAME
index: 161
experiments: patterns
comment: |-
Parameters:
0: the illegal name
@ -7161,7 +7086,6 @@ InvalidInsideUnaryPattern:
correctionMessage: Try combining into a single pattern if possible, or enclose the inner pattern in parentheses.
analyzerCode: ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN
index: 150
experiments: patterns
comment: No parameters.
script: |
void f(x) {
@ -7173,7 +7097,6 @@ LatePatternVariableDeclaration:
correctionMessage: Try removing the keyword `late`.
analyzerCode: ParserErrorCode.LATE_PATTERN_VARIABLE_DECLARATION
index: 151
experiments: patterns
comment: No parameters.
script: |
void f(x) {
@ -7185,7 +7108,6 @@ PatternVariableDeclarationOutsideFunctionOrMethod:
correctionMessage: Try declaring ordinary variables and assigning from within a function or method.
analyzerCode: ParserErrorCode.PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD
index: 152
experiments: patterns
comment: No parameters.
script: |
class C {
@ -7197,7 +7119,6 @@ DefaultInSwitchExpression:
correctionMessage: Try replacing `default` with `_`.
analyzerCode: ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION
index: 153
experiments: patterns
comment: No parameters.
script: |
void f(x) => switch (x) {

View File

@ -1 +0,0 @@
--enable-experiment=class-modifiers,sealed-class

View File

@ -1 +0,0 @@
--enable-experiment=patterns

View File

@ -1,2 +0,0 @@
--enable-experiment=patterns
--enable-experiment=records

View File

@ -1 +0,0 @@
--enable-experiment=records

View File

@ -1 +0,0 @@
--enable-experiment=sealed-class,class-modifiers

View File

@ -333,8 +333,7 @@ class VMTestSuite extends TestSuite {
? '$buildDir/gen/kernel-service.dart.snapshot'
: '$buildDir/gen/kernel_service.dill';
var dfePath = Path(filename).absolute.toNativePath();
// Enable 'records' experiment as it is used by certain vm/cc unit tests.
final experiments = [...configuration.experiments, 'records'];
final experiments = [...configuration.experiments];
var args = [
...initialTargetArguments,
// '--dfe' must be the first VM argument for run_vm_test to pick it up.

View File

@ -30,7 +30,7 @@ runTestCaseJit(Uri source) async {
final target = VmTarget(TargetFlags());
Component component = await compileTestCaseToKernelProgram(source,
target: target, experimentalFlags: ['class-modifiers']);
target: target, experimentalFlags: []);
final coreTypes = CoreTypes(component);
@ -54,7 +54,7 @@ runTestCaseAot(Uri source) async {
final target = VmTarget(TargetFlags(supportMirrors: false));
Component component = await compileTestCaseToKernelProgram(source,
target: target, experimentalFlags: ['class-modifiers']);
target: target, experimentalFlags: []);
const bool useGlobalTypeFlowAnalysis = true;
const bool enableAsserts = false;

View File

@ -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.
// VMOptions=--enable-experiment=patterns
// @dart=3.0
// ignore_for_file: experiment_not_enabled

View File

@ -4,8 +4,6 @@
// Verifies that compiler can eliminate record allocation.
// SharedOptions=--enable-experiment=records
import 'package:vm/testing/il_matchers.dart';
@pragma('vm:prefer-inline')

View File

@ -5,8 +5,6 @@
// Verifies that compiler can propagate static types through record fields
// and recognize int/double operations on record fields.
// SharedOptions=--enable-experiment=records,patterns
import 'package:vm/testing/il_matchers.dart';
double d(int x) => x + double.parse('1.0');

View File

@ -4,8 +4,6 @@
// Verifies that compiler can unbox records in return values.
// SharedOptions=--enable-experiment=records
import 'package:vm/testing/il_matchers.dart';
@pragma('vm:never-inline')

View File

@ -6,7 +6,6 @@
// Verifies that compiler doesn't crash if there are two local
// variables with the same name in the same local scope.
// SharedOptions=--enable-experiment=patterns
import 'package:expect/expect.dart';

View File

@ -1,14 +1,7 @@
{
"version": 1,
"experimentSets": {
"sdkExperiments": [
"records",
"class-modifiers",
"sealed-class"
],
"nullSafety": [
"non-nullable"
],
"sdkExperiments": [],
"extensionTypes": [
"inline-class"
]
@ -29,186 +22,6 @@
}
},
"packages": {
"async": {
"experimentSet": "nullSafety"
},
"boolean_selector": {
"experimentSet": "nullSafety"
},
"characters": {
"experimentSet": "nullSafety"
},
"clock": {
"experimentSet": "nullSafety"
},
"collection": {
"experimentSet": "nullSafety"
},
"connectivity": {
"experimentSet": "nullSafety"
},
"connectivity_platform_interface": {
"experimentSet": "nullSafety"
},
"convert": {
"experimentSet": "nullSafety"
},
"crypto": {
"experimentSet": "nullSafety"
},
"csslib": {
"experimentSet": "nullSafety"
},
"dart_internal": {
"experimentSet": "nullSafety"
},
"device_info": {
"experimentSet": "nullSafety"
},
"device_info_platform_interface": {
"experimentSet": "nullSafety"
},
"fake_async": {
"experimentSet": "nullSafety"
},
"file": {
"experimentSet": "nullSafety"
},
"fixnum": {
"experimentSet": "nullSafety"
},
"flutter": {
"experimentSet": "nullSafety"
},
"flutter_driver": {
"experimentSet": "nullSafety"
},
"flutter_test": {
"experimentSet": "nullSafety"
},
"flutter_goldens": {
"experimentSet": "nullSafety"
},
"flutter_goldens_client": {
"experimentSet": "nullSafety"
},
"http": {
"experimentSet": "nullSafety"
},
"http_parser": {
"experimentSet": "nullSafety"
},
"intl": {
"experimentSet": "nullSafety"
},
"js": {
"experimentSet": "nullSafety"
},
"logging": {
"experimentSet": "nullSafety"
},
"matcher": {
"experimentSet": "nullSafety"
},
"meta": {
"experimentSet": "nullSafety"
},
"native_assets_builder": {
"experimentSet": "nullSafety"
},
"native_stack_traces": {
"experimentSet": "nullSafety"
},
"observatory": {
"experimentSet": "nullSafety"
},
"observatory_test_package": {
"experimentSet": "nullSafety"
},
"path": {
"experimentSet": "nullSafety"
},
"pedantic": {
"experimentSet": "nullSafety"
},
"platform": {
"experimentSet": "nullSafety"
},
"plugin_platform_interface": {
"experimentSet": "nullSafety"
},
"pool": {
"experimentSet": "nullSafety"
},
"process": {
"experimentSet": "nullSafety"
},
"pub_semver": {
"experimentSet": "nullSafety"
},
"sky_engine": {
"experimentSet": "nullSafety"
},
"source_maps": {
"experimentSet": "nullSafety"
},
"source_map_stack_trace": {
"experimentSet": "nullSafety"
},
"source_span": {
"experimentSet": "nullSafety"
},
"stack_trace": {
"experimentSet": "nullSafety"
},
"stream_channel": {
"experimentSet": "nullSafety"
},
"string_scanner": {
"experimentSet": "nullSafety"
},
"term_glyph": {
"experimentSet": "nullSafety"
},
"test": {
"experimentSet": "nullSafety"
},
"test_api": {
"experimentSet": "nullSafety"
},
"test_core": {
"experimentSet": "nullSafety"
},
"typed_data": {
"experimentSet": "nullSafety"
},
"url_launcher": {
"experimentSet": "nullSafety"
},
"url_launcher_linux": {
"experimentSet": "nullSafety"
},
"url_launcher_macos": {
"experimentSet": "nullSafety"
},
"url_launcher_platform_interface": {
"experimentSet": "nullSafety"
},
"url_launcher_windows": {
"experimentSet": "nullSafety"
},
"vector_math": {
"experimentSet": "nullSafety"
},
"video_player": {
"experimentSet": "nullSafety"
},
"video_player_platform_interface": {
"experimentSet": "nullSafety"
},
"video_player_web": {
"experimentSet": "nullSafety"
},
"web": {
"experimentSet": "extensionTypes"
}

View File

@ -4,7 +4,6 @@
// SharedObjects=ffi_test_functions
// VMOptions=--enable-experiment=records
import 'dylib_utils.dart';

View File

@ -1,20 +0,0 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// 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.
// @dart = 2.9
main() {
var r1 = const (42);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
// ^
// [analyzer] SYNTACTIC_ERROR.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA
// [cfe] A record literal with exactly one positional field requires a trailing comma.
var r2 = const ();
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
}

View File

@ -1,61 +0,0 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// 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.
// @dart = 2.9
main() {
var record1 = (1, 2, a: 3, b: 4);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record1);
// With ending comma.
var record2 = (42, 42, 42, );
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record2);
var record3 = (foo: 42, bar: 42, 42, baz: 42, );
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record3);
// Nested.
var record4 = ((42, 42), 42);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record4);
// With function inside.
var record5 = ((foo, bar) => 42, 42);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record5);
// 1 record entry with trailing comma.
var record6 = (42, );
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record6);
// Const records.
var record7 = const (42, );
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record7);
var record8 = const (42, foo: "bar");
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record8);
}

View File

@ -1,38 +0,0 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// 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.
// @dart = 2.9
main() {
(int, int, {/*missing*/}) r1 = (1, 2);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST
// [cfe] The list of named fields in a record type can't be empty.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
(int /* missing trailing comma */ ) r2 = (1, );
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA
// [cfe] A record type with exactly one positional field requires a trailing comma.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
() emptyRecord = ();
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(emptyRecord);
}

View File

@ -1,222 +0,0 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// 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.
// @dart = 2.9
main() {
(int, int) record1 = (1, 2);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record1);
(int x, int y) record1Named = (1, 2);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record1Named);
(int, int, ) record2 = (1, 2);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record2);
(int x, int y, ) record2Named = (1, 2);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record2Named);
(int, int, {int a, int b}) record3 = (1, 2, a: 3, b: 4);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record3);
(int x, int y, {int a, int b}) record3Named = (1, 2, a: 3, b: 4);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record3Named);
(int, int, {int a, int b, }) record4 = (1, 2, a: 3, b: 4);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record4);
(int x, int y, {int a, int b, }) record4Named = (1, 2, a: 3, b: 4);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(record4Named);
print(foo((42, b: true), 42));
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
Bar b = new Bar();
print(b.foo(42));
(int, int) Function ((int, int) a) z1 = ((int, int) a) { return (42, 42); };
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
final (int x, int y) finalRecordType = (42, 42);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
List<(int, int)> listOfRecords = [];
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
var listOfRecords2 = <(int, int)>[];
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
(int, ) oneElementRecord = (1, );
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(oneElementRecord);
({int ok}) oneElementNamedRecord = (ok: 1);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
print(oneElementNamedRecord);
}
(int, T) f1<T>(T t) {
// [error column 1, length 1]
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
return (42, t);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
}
(int, T) f2<T>(T t) => (42, t);
// [error column 1, length 1]
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
(int a, String b) get topLevelGetterType => throw '';
// [error column 1, length 1]
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
(int, int) foo((int, {bool b}) inputRecord, int x) {
// [error column 1, length 1]
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
if (inputRecord.b) return (42, 42);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
return (1, 1, );
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
}
class Bar {
(int, int) foo(int x) => (42, 42);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
static (int x, int y) staticRecordType = (42, 42);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
(int a, String b) get instanceGetterType => throw '';
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
static (int a, String b) get staticGetterType => throw '';
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
(int, T) f1<T>(T t) {
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
return (42, t);
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
}
(int, T) f2<T>(T t) => (42, t);
//^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the experimental 'records' language feature to be enabled.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'records' language feature is disabled for this library.
}

View File

@ -163,6 +163,7 @@ features:
void main() {
print('feature enabled');
}
expired: true
class-modifiers:
help: "Class modifiers"
@ -172,6 +173,7 @@ features:
void main() {
print('feature enabled');
}
expired: true
records:
help: "Records"
@ -181,6 +183,7 @@ features:
void main() {
print('${x.$1} ${x.a}');
}
expired: true
patterns:
help: "Patterns"
@ -190,14 +193,15 @@ features:
final [a, b] = ['feature', 'enabled'];
print('$a $b');
}
expired: true
unnamed-libraries:
help: "Unnamed libraries"
enabledIn: '2.19.0'
expired: true
validation: |
library;
void main() => print('feature enabled');
expired: true
alternative-invalidation-strategy:
help: "Alternative invalidation strategy for incremental compilation."
@ -208,7 +212,6 @@ features:
inference-update-1:
help: "Horizontal type inference for function expressions passed to generic invocations."
enabledIn: '2.18.0'
expired: true
validation: |
void test(List<int> list) {
var a = list.fold(0, (x, y) => x + y);
@ -222,6 +225,7 @@ features:
void main() {
test([1, 2, 3]);
}
expired: true
enhanced-enums:
help: "Enhanced Enums"