mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 10:48:25 +00:00
Expire experiments released in earlier stable versions.
Remove messages referring to expired `non-nullable` experiment. Remove occurrences of --enable-experiment with expired experiments. TEST=Flags were expired. If existing tests still run, it's a success. Change-Id: Id66d78eb0a3191ec5e31375faf0effd9ea7b768f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219789 Auto-Submit: Lasse R.H. Nielsen <lrn@google.com> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
parent
bbff4d9589
commit
2360783808
|
@ -3271,48 +3271,6 @@ Message _withArgumentsExperimentNotEnabled(String string, String string2) {
|
|||
arguments: {'string': string, 'string2': string2});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeExperimentNotEnabledNoFlag =
|
||||
messageExperimentNotEnabledNoFlag;
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const MessageCode messageExperimentNotEnabledNoFlag = const MessageCode(
|
||||
"ExperimentNotEnabledNoFlag",
|
||||
analyzerCodes: <String>["ParserErrorCode.EXPERIMENT_NOT_ENABLED"],
|
||||
problemMessage:
|
||||
r"""This requires the null safety language feature, which is experimental.""",
|
||||
correctionMessage:
|
||||
r"""You can enable the experiment using the '--enable-experiment=non-nullable' command line option.""");
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Template<Message Function(String string2)>
|
||||
templateExperimentNotEnabledNoFlagInvalidLanguageVersion =
|
||||
const Template<Message Function(String string2)>(
|
||||
problemMessageTemplate:
|
||||
r"""This requires the null safety language feature, which is experimental and requires language version of #string2 or higher.""",
|
||||
correctionMessageTemplate:
|
||||
r"""You can enable the experiment using the '--enable-experiment=non-nullable' command line option.""",
|
||||
withArguments:
|
||||
_withArgumentsExperimentNotEnabledNoFlagInvalidLanguageVersion);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Message Function(String string2)>
|
||||
codeExperimentNotEnabledNoFlagInvalidLanguageVersion =
|
||||
const Code<Message Function(String string2)>(
|
||||
"ExperimentNotEnabledNoFlagInvalidLanguageVersion",
|
||||
analyzerCodes: <String>["ParserErrorCode.EXPERIMENT_NOT_ENABLED"]);
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
Message _withArgumentsExperimentNotEnabledNoFlagInvalidLanguageVersion(
|
||||
String string2) {
|
||||
if (string2.isEmpty) throw 'No string provided';
|
||||
return new Message(codeExperimentNotEnabledNoFlagInvalidLanguageVersion,
|
||||
problemMessage:
|
||||
"""This requires the null safety language feature, which is experimental and requires language version of ${string2} or higher.""",
|
||||
correctionMessage: """You can enable the experiment using the '--enable-experiment=non-nullable' command line option.""",
|
||||
arguments: {'string2': string2});
|
||||
}
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
|
||||
const Code<Null> codeExplicitExtensionArgumentMismatch =
|
||||
messageExplicitExtensionArgumentMismatch;
|
||||
|
|
|
@ -89,7 +89,6 @@ Future runTest(Test test, String config,
|
|||
'--libraries-spec=$sdkLibrariesSpecificationPath',
|
||||
'--packages=${Platform.packageConfig}',
|
||||
Flags.testMode,
|
||||
'--enable-experiment=extension-methods',
|
||||
input,
|
||||
]..addAll(options);
|
||||
print("Compiling dart2js ${arguments.join(' ')}");
|
||||
|
|
|
@ -125,17 +125,17 @@ const Map<ExperimentalFlag, bool> expiredExperimentalFlags = {
|
|||
ExperimentalFlag.constructorTearoffs: false,
|
||||
ExperimentalFlag.controlFlowCollections: true,
|
||||
ExperimentalFlag.enhancedEnums: false,
|
||||
ExperimentalFlag.extensionMethods: false,
|
||||
ExperimentalFlag.extensionMethods: true,
|
||||
ExperimentalFlag.extensionTypes: false,
|
||||
ExperimentalFlag.genericMetadata: false,
|
||||
ExperimentalFlag.genericMetadata: true,
|
||||
ExperimentalFlag.namedArgumentsAnywhere: false,
|
||||
ExperimentalFlag.nonNullable: false,
|
||||
ExperimentalFlag.nonfunctionTypeAliases: false,
|
||||
ExperimentalFlag.nonNullable: true,
|
||||
ExperimentalFlag.nonfunctionTypeAliases: true,
|
||||
ExperimentalFlag.setLiterals: true,
|
||||
ExperimentalFlag.spreadCollections: true,
|
||||
ExperimentalFlag.superParameters: false,
|
||||
ExperimentalFlag.testExperiment: false,
|
||||
ExperimentalFlag.tripleShift: false,
|
||||
ExperimentalFlag.tripleShift: true,
|
||||
ExperimentalFlag.valueClass: false,
|
||||
ExperimentalFlag.variance: false,
|
||||
};
|
||||
|
|
|
@ -12,8 +12,6 @@ import 'package:_fe_analyzer_shared/src/scanner/scanner.dart' show Token;
|
|||
|
||||
import 'package:kernel/ast.dart';
|
||||
|
||||
import '../../api_prototype/experimental_flags.dart';
|
||||
|
||||
import '../fasta_codes.dart';
|
||||
|
||||
import '../problems.dart' as problems
|
||||
|
@ -97,8 +95,7 @@ abstract class StackListenerImpl extends StackListener {
|
|||
token.charOffset,
|
||||
token.charCount);
|
||||
}
|
||||
} else if (libraryBuilder.loader.target
|
||||
.isExperimentEnabledByDefault(ExperimentalFlag.nonNullable)) {
|
||||
} else {
|
||||
if (libraryBuilder.languageVersion.version <
|
||||
libraryBuilder.enableNonNullableVersionInLibrary) {
|
||||
addProblem(
|
||||
|
@ -110,25 +107,6 @@ abstract class StackListenerImpl extends StackListener {
|
|||
addProblem(templateExperimentDisabled.withArguments('non-nullable'),
|
||||
token.offset, noLength);
|
||||
}
|
||||
} else if (!libraryBuilder.loader.target
|
||||
.isExperimentEnabledGlobally(ExperimentalFlag.nonNullable)) {
|
||||
if (libraryBuilder.languageVersion.version <
|
||||
libraryBuilder.enableNonNullableVersionInLibrary) {
|
||||
addProblem(
|
||||
templateExperimentNotEnabledNoFlagInvalidLanguageVersion
|
||||
.withArguments(
|
||||
libraryBuilder.enableNonNullableVersionInLibrary.toText()),
|
||||
token.offset,
|
||||
noLength);
|
||||
} else {
|
||||
addProblem(messageExperimentNotEnabledNoFlag, token.offset, noLength);
|
||||
}
|
||||
} else {
|
||||
addProblem(
|
||||
templateExperimentNotEnabled.withArguments('non-nullable',
|
||||
libraryBuilder.enableNonNullableVersionInLibrary.toText()),
|
||||
token.offset,
|
||||
noLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -282,16 +282,6 @@ ExperimentNotEnabled:
|
|||
correctionMessage: "Try updating your pubspec.yaml to set the minimum SDK constraint to #string2 or higher, and running 'pub get'."
|
||||
analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED
|
||||
|
||||
ExperimentNotEnabledNoFlag:
|
||||
problemMessage: "This requires the null safety language feature, which is experimental."
|
||||
correctionMessage: "You can enable the experiment using the '--enable-experiment=non-nullable' command line option."
|
||||
analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED
|
||||
|
||||
ExperimentNotEnabledNoFlagInvalidLanguageVersion:
|
||||
problemMessage: "This requires the null safety language feature, which is experimental and requires language version of #string2 or higher."
|
||||
correctionMessage: "You can enable the experiment using the '--enable-experiment=non-nullable' command line option."
|
||||
analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED
|
||||
|
||||
ExperimentDisabled:
|
||||
problemMessage: "This requires the '#string' language feature to be enabled."
|
||||
correctionMessage: "The feature is on by default but is currently disabled, maybe because the '--enable-experiment=no-#string' command line option is passed."
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright (c) 2019, 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
|
||||
// SharedOptions=--enable-experiment=extension-methods
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright (c) 2019, 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
|
||||
// SharedOptions=--enable-experiment=extension-methods
|
||||
|
||||
class A1 {}
|
||||
|
||||
|
|
|
@ -18,7 +18,16 @@ namespace dart {
|
|||
|
||||
bool GetExperimentalFeatureDefault(ExperimentalFeature feature) {
|
||||
constexpr bool kFeatureValues[] = {
|
||||
true, true, true, true, true, true, true, true, true, true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
};
|
||||
ASSERT(static_cast<size_t>(feature) < ARRAY_SIZE(kFeatureValues));
|
||||
return kFeatureValues[static_cast<int>(feature)];
|
||||
|
|
|
@ -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=non-nullable
|
||||
|
||||
typedef T0 = void;
|
||||
typedef T1 = Function;
|
||||
typedef T2<X> = List<X>;
|
||||
|
|
|
@ -2,15 +2,13 @@
|
|||
// 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=non-nullable
|
||||
|
||||
typedef T0 = Function?;
|
||||
typedef T1<X> = List<X?>?;
|
||||
typedef T2<X, Y> = Map<X?, Y?>?;
|
||||
typedef T3 = Never? Function(void)?;
|
||||
typedef T4<X> = X? Function(X?, {required X? name})?;
|
||||
typedef T5<X extends String, Y extends List<X?>> =
|
||||
X? Function(Y?, [Map<Y, Y?>]);
|
||||
typedef T5<X extends String, Y extends List<X?>> = X? Function(Y?,
|
||||
[Map<Y, Y?>]);
|
||||
|
||||
void main() {
|
||||
// ignore:unused_local_variable
|
||||
|
|
|
@ -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=extension-methods
|
||||
|
||||
// Tests exported extensions.
|
||||
|
||||
import "regress_flutter_42845_lib.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=extension-methods
|
||||
|
||||
library lib;
|
||||
|
||||
import "dart:mirrors";
|
||||
|
|
|
@ -151,6 +151,7 @@ features:
|
|||
S s = 'feature enabled';
|
||||
print(s);
|
||||
}
|
||||
expired: true
|
||||
|
||||
non-nullable:
|
||||
help: "Non Nullable by default"
|
||||
|
@ -161,10 +162,12 @@ features:
|
|||
int? a = null;
|
||||
print('feature enabled');
|
||||
}
|
||||
expired: true
|
||||
|
||||
extension-methods:
|
||||
help: "Extension Methods"
|
||||
enabledIn: '2.6.0'
|
||||
expired: true
|
||||
|
||||
constant-update-2018:
|
||||
help: "Enhanced constant expressions"
|
||||
|
@ -181,6 +184,7 @@ features:
|
|||
Allow annotations to accept type arguments;
|
||||
also allow generic function types as type arguments.
|
||||
enabledIn: '2.14.0'
|
||||
expired: true
|
||||
|
||||
set-literals:
|
||||
help: "Set Literals"
|
||||
|
@ -202,6 +206,7 @@ features:
|
|||
void main() {
|
||||
if ((A() >>> 1) == 42) print('feature enabled');
|
||||
}
|
||||
expired: true
|
||||
|
||||
constructor-tearoffs:
|
||||
help: "Allow constructor tear-offs and explicit generic instantiations."
|
||||
|
|
Loading…
Reference in a new issue