Version 2.15.0-141.0.dev
Merge commit '65184a9ff48f424d65e31591d715f04433728922' into 'dev'
diff --git a/pkg/front_end/analysis_options.yaml b/pkg/front_end/analysis_options.yaml
index b82914b..907c504 100644
--- a/pkg/front_end/analysis_options.yaml
+++ b/pkg/front_end/analysis_options.yaml
@@ -9,6 +9,7 @@
- curly_braces_in_flow_control_structures
- prefer_adjacent_string_concatenation
- unawaited_futures
+ - avoid_void_async
- recursive_getters
- avoid_empty_else
- empty_statements
diff --git a/pkg/front_end/test/ast_nodes_has_to_string_test.dart b/pkg/front_end/test/ast_nodes_has_to_string_test.dart
index 705ed30..d9ddaba 100644
--- a/pkg/front_end/test/ast_nodes_has_to_string_test.dart
+++ b/pkg/front_end/test/ast_nodes_has_to_string_test.dart
@@ -10,7 +10,7 @@
import 'incremental_suite.dart' as helper;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
exitCode = 1;
Map<Uri, List<Class>> classMap = {};
Map<Uri, List<Class>> classMapWithOne = {};
diff --git a/pkg/front_end/test/binary_md_vm_tags_and_version_git_test.dart b/pkg/front_end/test/binary_md_vm_tags_and_version_git_test.dart
index 537c165..fb3e464 100644
--- a/pkg/front_end/test/binary_md_vm_tags_and_version_git_test.dart
+++ b/pkg/front_end/test/binary_md_vm_tags_and_version_git_test.dart
@@ -29,7 +29,7 @@
// Match stuff like "kNullConstant = 0,"
final RegExp constantTagParser = new RegExp(r"k(\w*)\s*=\s*(\d+)");
-void main() async {
+Future<void> main() async {
File binaryMd = new File("$repoDir/pkg/kernel/binary.md");
String binaryMdContent = binaryMd.readAsStringSync();
diff --git a/pkg/front_end/test/class_hierarchy/class_hierarchy_test.dart b/pkg/front_end/test/class_hierarchy/class_hierarchy_test.dart
index 15e0fa5..4acaf78 100644
--- a/pkg/front_end/test/class_hierarchy/class_hierarchy_test.dart
+++ b/pkg/front_end/test/class_hierarchy/class_hierarchy_test.dart
@@ -13,7 +13,7 @@
import 'package:kernel/ast.dart';
import 'package:kernel/core_types.dart';
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await runTests<Features>(dataDir,
args: args,
diff --git a/pkg/front_end/test/compile_benchmark_helper.dart b/pkg/front_end/test/compile_benchmark_helper.dart
index 823a7bc..95a8f54 100644
--- a/pkg/front_end/test/compile_benchmark_helper.dart
+++ b/pkg/front_end/test/compile_benchmark_helper.dart
@@ -4,7 +4,7 @@
import '../tool/_fasta/entry_points.dart' show compileEntryPoint;
-void main(List<String> arguments) async {
+Future<void> main(List<String> arguments) async {
await compileEntryPoint(arguments);
if (numCalls.isNotEmpty) {
print("[");
diff --git a/pkg/front_end/test/compile_dart2js_with_no_sdk_test.dart b/pkg/front_end/test/compile_dart2js_with_no_sdk_test.dart
index 74bafaa..3e51713 100644
--- a/pkg/front_end/test/compile_dart2js_with_no_sdk_test.dart
+++ b/pkg/front_end/test/compile_dart2js_with_no_sdk_test.dart
@@ -6,7 +6,7 @@
import 'incremental_suite.dart' show TestIncrementalCompiler, getOptions;
-void main() async {
+Future<void> main() async {
final Uri dart2jsUrl = Uri.base.resolve("pkg/compiler/bin/dart2js.dart");
CompilerOptions options = getOptions();
options.sdkSummary = options.sdkSummary!.resolve("nonexisting.dill");
diff --git a/pkg/front_end/test/compile_with_no_sdk_test.dart b/pkg/front_end/test/compile_with_no_sdk_test.dart
index d8f45308..0b34d97 100644
--- a/pkg/front_end/test/compile_with_no_sdk_test.dart
+++ b/pkg/front_end/test/compile_with_no_sdk_test.dart
@@ -7,7 +7,7 @@
import 'incremental_suite.dart' show TestIncrementalCompiler, getOptions;
-void main() async {
+Future<void> main() async {
await compile("import 'foo.dart' if (dart.library.bar) 'baz.dart';");
}
diff --git a/pkg/front_end/test/constant_evaluator_benchmark.dart b/pkg/front_end/test/constant_evaluator_benchmark.dart
index 1d6eddd..5a817a6 100644
--- a/pkg/front_end/test/constant_evaluator_benchmark.dart
+++ b/pkg/front_end/test/constant_evaluator_benchmark.dart
@@ -131,7 +131,7 @@
late IncrementalCompiler incrementalCompiler;
-void main(List<String> arguments) async {
+Future<void> main(List<String> arguments) async {
Uri? platformUri;
Uri mainUri;
bool nnbd = false;
diff --git a/pkg/front_end/test/covariance_check/covariance_check_test.dart b/pkg/front_end/test/covariance_check/covariance_check_test.dart
index eb7cc24..4f59ddc 100644
--- a/pkg/front_end/test/covariance_check/covariance_check_test.dart
+++ b/pkg/front_end/test/covariance_check/covariance_check_test.dart
@@ -11,7 +11,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart';
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await runTests<String>(dataDir,
args: args,
diff --git a/pkg/front_end/test/crashing_test_case_minimizer.dart b/pkg/front_end/test/crashing_test_case_minimizer.dart
index 980721c..c5e60d5 100644
--- a/pkg/front_end/test/crashing_test_case_minimizer.dart
+++ b/pkg/front_end/test/crashing_test_case_minimizer.dart
@@ -19,7 +19,7 @@
// TODO(jensj): Add asserts or similar where - after each rewrite - we run the
// parser on it and verifies that no syntax errors have been introduced.
-void main(List<String> arguments) async {
+Future<void> main(List<String> arguments) async {
String filename;
Uri loadJson;
for (String arg in arguments) {
diff --git a/pkg/front_end/test/dartdoc_test_test.dart b/pkg/front_end/test/dartdoc_test_test.dart
index a3570f1..455a8cf 100644
--- a/pkg/front_end/test/dartdoc_test_test.dart
+++ b/pkg/front_end/test/dartdoc_test_test.dart
@@ -9,7 +9,7 @@
import "../tool/dart_doctest_impl.dart" as impl;
-void main() async {
+Future<void> main() async {
expectCategory = "comment extraction";
testCommentExtraction();
@@ -20,7 +20,7 @@
await testRunningTests();
}
-void testRunningTests() async {
+Future<void> testRunningTests() async {
MemoryFileSystem memoryFileSystem =
new MemoryFileSystem(new Uri(scheme: "darttest", path: "/"));
HybridFileSystem hybridFileSystem = new HybridFileSystem(memoryFileSystem);
diff --git a/pkg/front_end/test/desugar_test.dart b/pkg/front_end/test/desugar_test.dart
index 5b7539b2..31089ed 100644
--- a/pkg/front_end/test/desugar_test.dart
+++ b/pkg/front_end/test/desugar_test.dart
@@ -23,7 +23,7 @@
import 'package:kernel/ast.dart' as ir;
import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder;
-void main() async {
+Future<void> main() async {
await asyncTest(() async {
await testRedirectingFactoryDirect();
await testRedirectingFactorySerialized();
diff --git a/pkg/front_end/test/dill_round_trip_test.dart b/pkg/front_end/test/dill_round_trip_test.dart
index 17bbe1d..32d5759 100644
--- a/pkg/front_end/test/dill_round_trip_test.dart
+++ b/pkg/front_end/test/dill_round_trip_test.dart
@@ -15,7 +15,7 @@
import 'incremental_suite.dart'
show checkIsEqual, getOptions, normalCompilePlain;
-void main() async {
+Future<void> main() async {
final Uri dart2jsUrl = Uri.base.resolve("pkg/compiler/bin/dart2js.dart");
Stopwatch stopwatch = new Stopwatch()..start();
Component compiledComponent = await normalCompilePlain(dart2jsUrl,
diff --git a/pkg/front_end/test/enable_non_nullable/enable_non_nullable_test.dart b/pkg/front_end/test/enable_non_nullable/enable_non_nullable_test.dart
index b15d91f..f5fb221 100644
--- a/pkg/front_end/test/enable_non_nullable/enable_non_nullable_test.dart
+++ b/pkg/front_end/test/enable_non_nullable/enable_non_nullable_test.dart
@@ -20,7 +20,7 @@
/// The version used in this test as the experiment enabled version.
const Version experimentEnabledVersion = const Version(2, 10);
-void main() async {
+Future<void> main() async {
print('--------------------------------------------------------------------');
print('Test off-by-default with command-line flag');
print('--------------------------------------------------------------------');
@@ -58,7 +58,7 @@
versionOptsInAllowed: experimentReleaseVersion);
}
-void test(
+Future<void> test(
{bool enableNonNullableByDefault,
bool enableNonNullableExplicitly,
Version versionImpliesOptIn,
diff --git a/pkg/front_end/test/extensions/extensions_test.dart b/pkg/front_end/test/extensions/extensions_test.dart
index c811201..2666476 100644
--- a/pkg/front_end/test/extensions/extensions_test.dart
+++ b/pkg/front_end/test/extensions/extensions_test.dart
@@ -23,7 +23,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart';
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await runTests<Features>(dataDir,
args: args,
diff --git a/pkg/front_end/test/fasta/ambiguous_export_test.dart b/pkg/front_end/test/fasta/ambiguous_export_test.dart
index 579a3f8..fa0ef8f 100644
--- a/pkg/front_end/test/fasta/ambiguous_export_test.dart
+++ b/pkg/front_end/test/fasta/ambiguous_export_test.dart
@@ -20,7 +20,7 @@
import 'package:kernel/ast.dart'
show Field, Library, Name, Component, StringLiteral;
-void main() async {
+Future<void> main() async {
await asyncTest(() async {
Uri uri = Uri.parse("org.dartlang.fasta:library");
Library library = new Library(uri, fileUri: uri);
diff --git a/pkg/front_end/test/fasta/analyze_git_test.dart b/pkg/front_end/test/fasta/analyze_git_test.dart
index 7ccff17..c649729 100644
--- a/pkg/front_end/test/fasta/analyze_git_test.dart
+++ b/pkg/front_end/test/fasta/analyze_git_test.dart
@@ -8,7 +8,7 @@
import "package:testing/src/run_tests.dart" as testing show main;
-void main() async {
+Future<void> main() async {
// This method is async, but keeps a port open to prevent the VM from exiting
// prematurely.
// Note: if you change this file, also change
diff --git a/pkg/front_end/test/fasta/analyze_src_with_lints_git_test.dart b/pkg/front_end/test/fasta/analyze_src_with_lints_git_test.dart
index 34ca1e2..b4b0e5f 100644
--- a/pkg/front_end/test/fasta/analyze_src_with_lints_git_test.dart
+++ b/pkg/front_end/test/fasta/analyze_src_with_lints_git_test.dart
@@ -8,7 +8,7 @@
import "package:testing/src/run_tests.dart" as testing show main;
-void main() async {
+Future<void> main() async {
await testing.main(<String>[
"--config=pkg/front_end/testing_with_lints.json",
"--verbose",
diff --git a/pkg/front_end/test/fasta/expression_suite.dart b/pkg/front_end/test/fasta/expression_suite.dart
index 793aeb0..d6159f9 100644
--- a/pkg/front_end/test/fasta/expression_suite.dart
+++ b/pkg/front_end/test/fasta/expression_suite.dart
@@ -327,7 +327,7 @@
// Compile [test.expression], update [test.errors] with results.
// As a side effect - verify that generated procedure can be serialized.
- void compileExpression(TestCase test, IncrementalCompiler compiler,
+ Future<void> compileExpression(TestCase test, IncrementalCompiler compiler,
Component component, Context context) async {
Map<String, DartType> definitions = {};
for (String name in test.definitions) {
@@ -386,7 +386,7 @@
context.fileSystem.entityForUri(dillFileUri).writeAsBytesSync(
await new File.fromUri(dillFileUri).readAsBytes());
}
- compileExpression(test, sourceCompiler, component, context);
+ await compileExpression(test, sourceCompiler, component, context);
var dillCompiler =
new IncrementalCompiler(context.compilerContext, dillFileUri);
@@ -399,7 +399,7 @@
// Since it compiled successfully from source, the bootstrap-from-Dill
// should also succeed without errors.
assert(errors.isEmpty);
- compileExpression(test, dillCompiler, component, context);
+ await compileExpression(test, dillCompiler, component, context);
}
return new Result.pass(tests);
}
diff --git a/pkg/front_end/test/fasta/generator_to_string_test.dart b/pkg/front_end/test/fasta/generator_to_string_test.dart
index 2888840..b2c4f52 100644
--- a/pkg/front_end/test/fasta/generator_to_string_test.dart
+++ b/pkg/front_end/test/fasta/generator_to_string_test.dart
@@ -65,7 +65,7 @@
Expect.stringEquals(expected, "$generator");
}
-void main() async {
+Future<void> main() async {
await CompilerContext.runWithDefaultOptions((CompilerContext c) async {
Token token = scanString(" myToken").tokens;
Uri uri = Uri.parse("org-dartlang-test:my_library.dart");
diff --git a/pkg/front_end/test/fasta/object_supertype_test.dart b/pkg/front_end/test/fasta/object_supertype_test.dart
index 62b9210..b588191 100644
--- a/pkg/front_end/test/fasta/object_supertype_test.dart
+++ b/pkg/front_end/test/fasta/object_supertype_test.dart
@@ -80,7 +80,7 @@
.map((DiagnosticMessage message) => getMessageCodeObject(message).name)
.toSet();
- void check(String objectHeader, List<Code> expectedCodes) async {
+ Future<void> check(String objectHeader, List<Code> expectedCodes) async {
List<DiagnosticMessage> messages = (await outline(objectHeader))
.where((DiagnosticMessage message) =>
!normalErrors.contains(getMessageCodeObject(message).name))
diff --git a/pkg/front_end/test/fasta/type_inference/factor_type_test.dart b/pkg/front_end/test/fasta/type_inference/factor_type_test.dart
index 65243ed..a365e93 100644
--- a/pkg/front_end/test/fasta/type_inference/factor_type_test.dart
+++ b/pkg/front_end/test/fasta/type_inference/factor_type_test.dart
@@ -102,7 +102,7 @@
typeToText(type, TypeRepresentation.analyzerNonNullableByDefault);
}
-void main() async {
+Future<void> main() async {
CompilerOptions options = new CompilerOptions()
..explicitExperimentalFlags[ExperimentalFlag.nonNullable] = true;
InternalCompilerResult result = await compileScript('',
diff --git a/pkg/front_end/test/flutter_gallery_leak_tester.dart b/pkg/front_end/test/flutter_gallery_leak_tester.dart
index 1b5e46b..973961d 100644
--- a/pkg/front_end/test/flutter_gallery_leak_tester.dart
+++ b/pkg/front_end/test/flutter_gallery_leak_tester.dart
@@ -26,7 +26,7 @@
// but assumes that flutter has been setup as by the script
// `tools/bots/flutter/compile_flutter.sh`.
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
if (Platform.isWindows) {
throw "This script cannot run on Windows as it uses non-Windows "
"assumptions both for the placement of pub packages and the presence "
diff --git a/pkg/front_end/test/generated_files_up_to_date_git_test.dart b/pkg/front_end/test/generated_files_up_to_date_git_test.dart
index 17773be..5161eef 100644
--- a/pkg/front_end/test/generated_files_up_to_date_git_test.dart
+++ b/pkg/front_end/test/generated_files_up_to_date_git_test.dart
@@ -20,7 +20,7 @@
final Uri repoDir = computeRepoDirUri();
-void main() async {
+Future<void> main() async {
messages();
experimentalFlags();
directParserAstHelper();
diff --git a/pkg/front_end/test/id_testing/id_testing_test.dart b/pkg/front_end/test/id_testing/id_testing_test.dart
index f3f465f..873dc8e 100644
--- a/pkg/front_end/test/id_testing/id_testing_test.dart
+++ b/pkg/front_end/test/id_testing/id_testing_test.dart
@@ -29,7 +29,7 @@
Library,
TreeNode;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await runTests<String>(dataDir,
args: args,
diff --git a/pkg/front_end/test/id_tests/assigned_variables_test.dart b/pkg/front_end/test/id_tests/assigned_variables_test.dart
index 53e04d5..1b325de 100644
--- a/pkg/front_end/test/id_tests/assigned_variables_test.dart
+++ b/pkg/front_end/test/id_tests/assigned_variables_test.dart
@@ -18,7 +18,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart' hide Variance;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve(
'../../../_fe_analyzer_shared/test/flow_analysis/assigned_variables/'
'data'));
diff --git a/pkg/front_end/test/id_tests/constant_test.dart b/pkg/front_end/test/id_tests/constant_test.dart
index cdf28c3..54eccdb 100644
--- a/pkg/front_end/test/id_tests/constant_test.dart
+++ b/pkg/front_end/test/id_tests/constant_test.dart
@@ -22,7 +22,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart';
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script
.resolve('../../../_fe_analyzer_shared/test/constants/data'));
await runTests<String>(dataDir,
diff --git a/pkg/front_end/test/id_tests/definite_assignment_test.dart b/pkg/front_end/test/id_tests/definite_assignment_test.dart
index 09b7584..74afe1e 100644
--- a/pkg/front_end/test/id_tests/definite_assignment_test.dart
+++ b/pkg/front_end/test/id_tests/definite_assignment_test.dart
@@ -14,7 +14,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart' hide Variance;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve(
'../../../_fe_analyzer_shared/test/flow_analysis/definite_assignment/'
'data'));
diff --git a/pkg/front_end/test/id_tests/definite_unassignment_test.dart b/pkg/front_end/test/id_tests/definite_unassignment_test.dart
index 2d25641..30d0fb5 100644
--- a/pkg/front_end/test/id_tests/definite_unassignment_test.dart
+++ b/pkg/front_end/test/id_tests/definite_unassignment_test.dart
@@ -14,7 +14,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart' hide Variance;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve(
'../../../_fe_analyzer_shared/test/flow_analysis/definite_unassignment/'
'data'));
diff --git a/pkg/front_end/test/id_tests/inferred_type_arguments_test.dart b/pkg/front_end/test/id_tests/inferred_type_arguments_test.dart
index 32f5603..6c5aedc 100644
--- a/pkg/front_end/test/id_tests/inferred_type_arguments_test.dart
+++ b/pkg/front_end/test/id_tests/inferred_type_arguments_test.dart
@@ -14,7 +14,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart' hide Variance;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(
Platform.script.resolve('../../../_fe_analyzer_shared/test/'
'inference/inferred_type_arguments/data'));
diff --git a/pkg/front_end/test/id_tests/inferred_variable_types_test.dart b/pkg/front_end/test/id_tests/inferred_variable_types_test.dart
index 3049cb9..91c4800 100644
--- a/pkg/front_end/test/id_tests/inferred_variable_types_test.dart
+++ b/pkg/front_end/test/id_tests/inferred_variable_types_test.dart
@@ -14,7 +14,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart' hide Variance;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(
Platform.script.resolve('../../../_fe_analyzer_shared/test/'
'inference/inferred_variable_types/data'));
diff --git a/pkg/front_end/test/id_tests/inheritance_test.dart b/pkg/front_end/test/id_tests/inheritance_test.dart
index f6cdbe5..3d6aba4 100644
--- a/pkg/front_end/test/id_tests/inheritance_test.dart
+++ b/pkg/front_end/test/id_tests/inheritance_test.dart
@@ -20,7 +20,7 @@
const String cfeFromBuilderMarker = 'cfe:builder';
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script
.resolve('../../../_fe_analyzer_shared/test/inheritance/data'));
await runTests<String>(dataDir,
diff --git a/pkg/front_end/test/id_tests/nullability_test.dart b/pkg/front_end/test/id_tests/nullability_test.dart
index de14982..d77f169 100644
--- a/pkg/front_end/test/id_tests/nullability_test.dart
+++ b/pkg/front_end/test/id_tests/nullability_test.dart
@@ -10,7 +10,7 @@
import 'package:front_end/src/testing/id_testing_helper.dart';
import 'package:kernel/ast.dart' hide Variance;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve(
'../../../_fe_analyzer_shared/test/flow_analysis/nullability/data'));
await runTests<String>(dataDir,
diff --git a/pkg/front_end/test/id_tests/reachability_test.dart b/pkg/front_end/test/id_tests/reachability_test.dart
index 288bee9..d486fde 100644
--- a/pkg/front_end/test/id_tests/reachability_test.dart
+++ b/pkg/front_end/test/id_tests/reachability_test.dart
@@ -15,7 +15,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart' hide Variance;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve(
'../../../_fe_analyzer_shared/test/flow_analysis/reachability/data'));
await runTests<Set<_ReachabilityAssertion>>(dataDir,
diff --git a/pkg/front_end/test/id_tests/type_promotion_test.dart b/pkg/front_end/test/id_tests/type_promotion_test.dart
index 52e0ec2..fed4245 100644
--- a/pkg/front_end/test/id_tests/type_promotion_test.dart
+++ b/pkg/front_end/test/id_tests/type_promotion_test.dart
@@ -12,7 +12,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart' hide Variance;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script
.resolve('../../../_fe_analyzer_shared/test/flow_analysis/type_promotion/'
'data'));
diff --git a/pkg/front_end/test/id_tests/why_not_promoted_test.dart b/pkg/front_end/test/id_tests/why_not_promoted_test.dart
index 8b8d215..ed82ac1 100644
--- a/pkg/front_end/test/id_tests/why_not_promoted_test.dart
+++ b/pkg/front_end/test/id_tests/why_not_promoted_test.dart
@@ -15,7 +15,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart' hide Variance, MapLiteralEntry;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(
Platform.script.resolve('../../../_fe_analyzer_shared/test/flow_analysis/'
'why_not_promoted/data'));
diff --git a/pkg/front_end/test/incremental_compiler_leak_test.dart b/pkg/front_end/test/incremental_compiler_leak_test.dart
index 675bee9..a9f3b81 100644
--- a/pkg/front_end/test/incremental_compiler_leak_test.dart
+++ b/pkg/front_end/test/incremental_compiler_leak_test.dart
@@ -12,10 +12,10 @@
const int limit = 10;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
LeakFinder heapHelper = new LeakFinder();
- heapHelper.start([
+ await heapHelper.start([
"--disable-dart-dev",
"--enable-asserts",
Platform.script.resolve("incremental_dart2js_tester.dart").toString(),
diff --git a/pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart b/pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart
index d335bf9..f4b0342 100644
--- a/pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart
+++ b/pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart
@@ -22,7 +22,7 @@
Directory outDir;
-void main() async {
+Future<void> main() async {
outDir =
Directory.systemTemp.createTempSync("incremental_load_from_dill_test");
try {
diff --git a/pkg/front_end/test/incremental_dart2js_test.dart b/pkg/front_end/test/incremental_dart2js_test.dart
index be9f6f5..3a36586 100644
--- a/pkg/front_end/test/incremental_dart2js_test.dart
+++ b/pkg/front_end/test/incremental_dart2js_test.dart
@@ -6,7 +6,7 @@
import "incremental_dart2js_tester.dart";
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
bool fast = true;
bool useExperimentalInvalidation = true;
bool addDebugBreaks = false;
diff --git a/pkg/front_end/test/incremental_dart2js_tester.dart b/pkg/front_end/test/incremental_dart2js_tester.dart
index 8837c39..3428af3 100644
--- a/pkg/front_end/test/incremental_dart2js_tester.dart
+++ b/pkg/front_end/test/incremental_dart2js_tester.dart
@@ -18,7 +18,7 @@
import "incremental_utils.dart" as util;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
bool fast = false;
bool useExperimentalInvalidation = false;
bool addDebugBreaks = false;
@@ -59,7 +59,7 @@
Dart2jsTester(this.useExperimentalInvalidation, this.fast,
this.addDebugBreaks, this.limit);
- void test() async {
+ Future<void> test() async {
helper.TestIncrementalCompiler compiler = await setup();
if (addDebugBreaks) {
debugger();
diff --git a/pkg/front_end/test/incremental_flutter_tester.dart b/pkg/front_end/test/incremental_flutter_tester.dart
index 5ebaf9a..3663d30 100644
--- a/pkg/front_end/test/incremental_flutter_tester.dart
+++ b/pkg/front_end/test/incremental_flutter_tester.dart
@@ -46,7 +46,7 @@
exit(1);
}
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
bool fast = false;
bool useExperimentalInvalidation = false;
File inputFile;
diff --git a/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart b/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
index 5fd461d..ac40f6e 100644
--- a/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
+++ b/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
@@ -73,7 +73,7 @@
CompilerOptions options;
IncrementalCompiler compiler;
- void compileExpectInitializeFailAndSpecificWarning(
+ Future<void> compileExpectInitializeFailAndSpecificWarning(
Code expectedWarningCode, bool writeFileOnCrashReport) async {
errorMessages.clear();
warningMessages.clear();
diff --git a/pkg/front_end/test/language_versioning/language_versioning_test.dart b/pkg/front_end/test/language_versioning/language_versioning_test.dart
index c1a9f1c..359c265 100644
--- a/pkg/front_end/test/language_versioning/language_versioning_test.dart
+++ b/pkg/front_end/test/language_versioning/language_versioning_test.dart
@@ -26,7 +26,7 @@
import 'package:kernel/ast.dart' show Component, Library, Version;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
// Fix default/max major and minor version so we can test it.
// This config sets it to 2.8.
TestConfigWithLanguageVersion cfeConfig =
diff --git a/pkg/front_end/test/language_versioning/language_versioning_up_to_date_git_test.dart b/pkg/front_end/test/language_versioning/language_versioning_up_to_date_git_test.dart
index 09ddce5..89c3833 100644
--- a/pkg/front_end/test/language_versioning/language_versioning_up_to_date_git_test.dart
+++ b/pkg/front_end/test/language_versioning/language_versioning_up_to_date_git_test.dart
@@ -16,7 +16,7 @@
String get dartVm => Platform.executable;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
ProcessResult result = await Process.run(
"python3", ["tools/make_version.py", "--no_git", "-q"],
workingDirectory: repoDir);
diff --git a/pkg/front_end/test/memory_file_system_test.dart b/pkg/front_end/test/memory_file_system_test.dart
index 3792f40..5c20d45 100644
--- a/pkg/front_end/test/memory_file_system_test.dart
+++ b/pkg/front_end/test/memory_file_system_test.dart
@@ -41,18 +41,18 @@
file = entityForPath(path);
}
- void test_createDirectory_doesNotExist() async {
+ Future<void> test_createDirectory_doesNotExist() async {
file.createDirectory();
expect(await file.exists(), true);
}
- void test_createDirectory_exists_asDirectory() async {
+ Future<void> test_createDirectory_exists_asDirectory() async {
file.createDirectory();
file.createDirectory();
expect(await file.exists(), true);
}
- void test_createDirectory_exists_asFile() async {
+ Future<void> test_createDirectory_exists_asFile() async {
file.writeAsStringSync('');
await expectLater(file.createDirectory, _throwsFileSystemException);
}
@@ -65,16 +65,16 @@
expect(file == entityForPath(join(tempPath, 'file.txt')), isTrue);
}
- void test_exists_directory_exists() async {
+ Future<void> test_exists_directory_exists() async {
file.createDirectory();
expect(await file.exists(), true);
}
- void test_exists_doesNotExist() async {
+ Future<void> test_exists_doesNotExist() async {
expect(await file.exists(), false);
}
- void test_exists_file_exists() async {
+ Future<void> test_exists_file_exists() async {
file.writeAsStringSync('x');
expect(await file.exists(), true);
}
@@ -87,57 +87,57 @@
expect(file.uri, context.toUri(path));
}
- void test_readAsBytes_badUtf8() async {
+ Future<void> test_readAsBytes_badUtf8() async {
// A file containing invalid UTF-8 can still be read as raw bytes.
List<int> bytes = [0xc0, 0x40]; // Invalid UTF-8
file.writeAsBytesSync(bytes);
expect(await file.readAsBytes(), bytes);
}
- void test_readAsBytes_doesNotExist() async {
+ Future<void> test_readAsBytes_doesNotExist() async {
await expectLater(file.readAsBytes, _throwsFileSystemException);
}
- void test_readAsBytes_exists() async {
+ Future<void> test_readAsBytes_exists() async {
var s = 'contents';
file.writeAsStringSync(s);
expect(await file.readAsBytes(), utf8.encode(s));
}
- void test_readAsString_badUtf8() async {
+ Future<void> test_readAsString_badUtf8() async {
file.writeAsBytesSync([0xc0, 0x40]); // Invalid UTF-8
await expectLater(file.readAsString, _throwsFileSystemException);
}
- void test_readAsString_doesNotExist() async {
+ Future<void> test_readAsString_doesNotExist() async {
await expectLater(file.readAsString, _throwsFileSystemException);
}
- void test_readAsString_exists() async {
+ Future<void> test_readAsString_exists() async {
var s = 'contents';
file.writeAsStringSync(s);
expect(await file.readAsString(), s);
}
- void test_readAsString_utf8() async {
+ Future<void> test_readAsString_utf8() async {
file.writeAsBytesSync([0xe2, 0x82, 0xac]); // Unicode € symbol, in UTF-8
expect(await file.readAsString(), '\u20ac');
}
- void test_writeAsBytesSync_directory() async {
+ Future<void> test_writeAsBytesSync_directory() async {
file.createDirectory();
await expectLater(
() => file.writeAsBytesSync([0]), _throwsFileSystemException);
}
- void test_writeAsBytesSync_modifyAfterRead() async {
+ Future<void> test_writeAsBytesSync_modifyAfterRead() async {
// For efficiency we do not make defensive copies.
file.writeAsBytesSync([1]);
(await file.readAsBytes())[0] = 2;
expect(await file.readAsBytes(), [2]);
}
- void test_writeAsBytesSync_modifyAfterWrite_Uint8List() async {
+ Future<void> test_writeAsBytesSync_modifyAfterWrite_Uint8List() async {
// For efficiency we do not make defensive copies.
var bytes = new Uint8List.fromList([1]);
file.writeAsBytesSync(bytes);
@@ -145,7 +145,7 @@
expect(await file.readAsBytes(), [2]);
}
- void test_writeAsBytesSync_modifyAfterWrite() async {
+ Future<void> test_writeAsBytesSync_modifyAfterWrite() async {
// For efficiency we generally do not make defensive copies, but on the
// other hrand we keep everything as `Uint8List`s internally, so in this
// case a copy is actually made.
@@ -155,25 +155,25 @@
expect(await file.readAsBytes(), [1]);
}
- void test_writeAsBytesSync_overwrite() async {
+ Future<void> test_writeAsBytesSync_overwrite() async {
file.writeAsBytesSync([1]);
file.writeAsBytesSync([2]);
expect(await file.readAsBytes(), [2]);
}
- void test_writeAsStringSync_directory() async {
+ Future<void> test_writeAsStringSync_directory() async {
file.createDirectory();
await expectLater(
() => file.writeAsStringSync(''), _throwsFileSystemException);
}
- void test_writeAsStringSync_overwrite() async {
+ Future<void> test_writeAsStringSync_overwrite() async {
file.writeAsStringSync('first');
file.writeAsStringSync('second');
expect(await file.readAsString(), 'second');
}
- void test_writeAsStringSync_utf8() async {
+ Future<void> test_writeAsStringSync_utf8() async {
file.writeAsStringSync('\u20ac'); // Unicode € symbol
expect(await file.readAsBytes(), [0xe2, 0x82, 0xac]);
}
@@ -223,7 +223,7 @@
Uri.parse('$tempUri/file.txt'));
}
- void test_entityForUri_fileUri_relative() async {
+ Future<void> test_entityForUri_fileUri_relative() async {
// A weird quirk of the Uri class is that it doesn't seem possible to create
// a `file:` uri with a relative path, no matter how many slashes you use or
// if you populate the fields directly. But just to be certain, try to do
diff --git a/pkg/front_end/test/multiple_simultaneous_compiles_test.dart b/pkg/front_end/test/multiple_simultaneous_compiles_test.dart
index e09aae3..df42515 100644
--- a/pkg/front_end/test/multiple_simultaneous_compiles_test.dart
+++ b/pkg/front_end/test/multiple_simultaneous_compiles_test.dart
@@ -18,7 +18,7 @@
import 'incremental_suite.dart' show getOptions;
-void main() async {
+Future<void> main() async {
Uri compileTarget = Platform.script.resolve("binary_md_dill_reader.dart");
if (!(new File.fromUri(compileTarget)).existsSync()) {
throw "$compileTarget doesn't exist";
diff --git a/pkg/front_end/test/patching/patching_test.dart b/pkg/front_end/test/patching/patching_test.dart
index 8ad7d4e..9b7d6d9 100644
--- a/pkg/front_end/test/patching/patching_test.dart
+++ b/pkg/front_end/test/patching/patching_test.dart
@@ -19,7 +19,7 @@
import 'package:front_end/src/testing/id_testing_utils.dart';
import 'package:kernel/ast.dart';
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await runTests<Features>(dataDir,
args: args,
diff --git a/pkg/front_end/test/predicates/predicate_test.dart b/pkg/front_end/test/predicates/predicate_test.dart
index 2660e72..ec7b50d 100644
--- a/pkg/front_end/test/predicates/predicate_test.dart
+++ b/pkg/front_end/test/predicates/predicate_test.dart
@@ -22,7 +22,7 @@
const String isNullMarker = 'is-null';
const String sentinelMarker = 'sentinel';
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await runTests<Features>(dataDir,
args: args,
diff --git a/pkg/front_end/test/read_dill_from_binary_md_git_test.dart b/pkg/front_end/test/read_dill_from_binary_md_git_test.dart
index 7d2da16..ec6277b 100644
--- a/pkg/front_end/test/read_dill_from_binary_md_git_test.dart
+++ b/pkg/front_end/test/read_dill_from_binary_md_git_test.dart
@@ -14,7 +14,7 @@
import 'utils/io_utils.dart' show computeRepoDir;
-void main() async {
+Future<void> main() async {
await testDart2jsCompile();
}
diff --git a/pkg/front_end/test/split_dill_test.dart b/pkg/front_end/test/split_dill_test.dart
index f4ebb71..16484f2 100644
--- a/pkg/front_end/test/split_dill_test.dart
+++ b/pkg/front_end/test/split_dill_test.dart
@@ -22,7 +22,7 @@
import 'utils/io_utils.dart' show computeRepoDir;
-void main() async {
+Future<void> main() async {
final Uri dart2jsUrl = Uri.base.resolve("pkg/compiler/bin/dart2js.dart");
Stopwatch stopwatch = new Stopwatch()..start();
Component component = await normalCompileToComponent(dart2jsUrl,
diff --git a/pkg/front_end/test/src/base/processed_options_test.dart b/pkg/front_end/test/src/base/processed_options_test.dart
index 529e56b..b771f32 100644
--- a/pkg/front_end/test/src/base/processed_options_test.dart
+++ b/pkg/front_end/test/src/base/processed_options_test.dart
@@ -77,7 +77,7 @@
expect(processed.fileSystem, same(fileSystem));
}
- void test_getSdkSummaryBytes_summaryLocationProvided() async {
+ Future<void> test_getSdkSummaryBytes_summaryLocationProvided() async {
var uri = Uri.parse('org-dartlang-test:///sdkSummary');
writeMockSummaryTo(uri);
@@ -95,7 +95,7 @@
mockSummary.libraries.single.importUri);
}
- void test_getSdkSummary_summaryLocationProvided() async {
+ Future<void> test_getSdkSummary_summaryLocationProvided() async {
var uri = Uri.parse('org-dartlang-test:///sdkSummary');
writeMockSummaryTo(uri);
await checkMockSummary(new CompilerOptions()
@@ -116,7 +116,7 @@
mockSummary.libraries.single.importUri);
}
- void test_getUriTranslator_explicitLibrariesSpec() async {
+ Future<void> test_getUriTranslator_explicitLibrariesSpec() async {
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///.packages'))
.writeAsStringSync('');
@@ -134,7 +134,7 @@
'/bar.dart');
}
- void test_getUriTranslator_inferredLibrariesSpec() async {
+ Future<void> test_getUriTranslator_inferredLibrariesSpec() async {
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///.packages'))
.writeAsStringSync('');
@@ -153,7 +153,7 @@
'/mysdk/lib/bar.dart');
}
- void test_getUriTranslator_notInferredLibrariesSpec() async {
+ Future<void> test_getUriTranslator_notInferredLibrariesSpec() async {
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///.packages'))
.writeAsStringSync('');
@@ -178,7 +178,7 @@
expect(packages.resolve(input), expected);
}
- void test_getUriTranslator_explicitPackagesFile() async {
+ Future<void> test_getUriTranslator_explicitPackagesFile() async {
// This .packages file should be ignored.
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///.packages'))
@@ -195,7 +195,8 @@
checkPackageExpansion('foo', 'baz', uriTranslator.packages);
}
- void test_getUriTranslator_explicitPackagesFile_withBaseLocation() async {
+ Future<void>
+ test_getUriTranslator_explicitPackagesFile_withBaseLocation() async {
// This .packages file should be ignored.
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///.packages'))
@@ -214,7 +215,7 @@
checkPackageExpansion('foo', 'base/location/baz', uriTranslator.packages);
}
- void test_getUriTranslator_implicitPackagesFile_ambiguous() async {
+ Future<void> test_getUriTranslator_implicitPackagesFile_ambiguous() async {
// This .packages file should be ignored.
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///.packages'))
@@ -231,7 +232,7 @@
checkPackageExpansion('foo', 'baz', uriTranslator.packages);
}
- void test_getUriTranslator_implicitPackagesFile_nextToScript() async {
+ Future<void> test_getUriTranslator_implicitPackagesFile_nextToScript() async {
// Create the base directory.
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///base/location/'))
@@ -256,7 +257,7 @@
checkPackageExpansion('foo', 'base/location/baz', uriTranslator.packages);
}
- void test_getUriTranslator_implicitPackagesFile_searchAbove() async {
+ Future<void> test_getUriTranslator_implicitPackagesFile_searchAbove() async {
// Create the base directory.
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///base/location/'))
@@ -277,7 +278,8 @@
checkPackageExpansion('foo', 'base/baz', uriTranslator.packages);
}
- void test_getUriTranslator_implicitPackagesFile_packagesDirectory() async {
+ Future<void>
+ test_getUriTranslator_implicitPackagesFile_packagesDirectory() async {
// Create the base directory.
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///base/location/'))
@@ -302,7 +304,7 @@
checkPackageExpansion('foo', 'base/baz', uriTranslator.packages);
}
- void test_getUriTranslator_implicitPackagesFile_noPackages() async {
+ Future<void> test_getUriTranslator_implicitPackagesFile_noPackages() async {
// Create the base directory.
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///base/location/'))
@@ -320,7 +322,7 @@
expect(uriTranslator.packages.packages, isEmpty);
}
- void test_getUriTranslator_noPackages() async {
+ Future<void> test_getUriTranslator_noPackages() async {
var errors = [];
// .packages file should be ignored.
fileSystem
@@ -337,7 +339,7 @@
startsWith(_stringPrefixOf(templateCantReadFile)));
}
- void test_validateOptions_noInputs() async {
+ Future<void> test_validateOptions_noInputs() async {
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///foo.dart'))
.writeAsStringSync('main(){}\n');
@@ -351,7 +353,7 @@
expect(result, isFalse);
}
- void test_validateOptions_input_doesnt_exist() async {
+ Future<void> test_validateOptions_input_doesnt_exist() async {
var errors = [];
var raw = new CompilerOptions()
..fileSystem = fileSystem
@@ -363,7 +365,7 @@
expect(result, isTrue);
}
- void test_validateOptions_root_exists() async {
+ Future<void> test_validateOptions_root_exists() async {
var sdkRoot = Uri.parse('org-dartlang-test:///sdk/root/');
fileSystem
// Note: this test is a bit hackish because the memory file system
@@ -390,7 +392,7 @@
expect(result, isTrue);
}
- void test_validateOptions_root_doesnt_exists() async {
+ Future<void> test_validateOptions_root_doesnt_exists() async {
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///foo.dart'))
.writeAsStringSync('main(){}\n');
@@ -407,7 +409,7 @@
startsWith(_stringPrefixOf(templateSdkRootNotFound)));
}
- void test_validateOptions_summary_exists() async {
+ Future<void> test_validateOptions_summary_exists() async {
var sdkSummary = Uri.parse('org-dartlang-test:///sdk/root/outline.dill');
fileSystem.entityForUri(sdkSummary).writeAsStringSync('\n');
fileSystem
@@ -426,7 +428,7 @@
expect(result, isTrue);
}
- void test_validateOptions_summary_doesnt_exists() async {
+ Future<void> test_validateOptions_summary_doesnt_exists() async {
fileSystem
.entityForUri(Uri.parse('org-dartlang-test:///foo.dart'))
.writeAsStringSync('main(){}\n');
@@ -443,7 +445,7 @@
startsWith(_stringPrefixOf(templateSdkSummaryNotFound)));
}
- void test_validateOptions_inferred_summary_exists() async {
+ Future<void> test_validateOptions_inferred_summary_exists() async {
var sdkRoot = Uri.parse('org-dartlang-test:///sdk/root/');
var sdkSummary =
Uri.parse('org-dartlang-test:///sdk/root/vm_platform_strong.dill');
@@ -465,7 +467,7 @@
expect(result, isTrue);
}
- void test_validateOptions_inferred_summary_doesnt_exists() async {
+ Future<void> test_validateOptions_inferred_summary_doesnt_exists() async {
var sdkRoot = Uri.parse('org-dartlang-test:///sdk/root/');
var sdkSummary = Uri.parse('org-dartlang-test:///sdk/root/outline.dill');
fileSystem.entityForUri(sdkRoot).writeAsStringSync('\n');
diff --git a/pkg/front_end/test/standard_file_system_test.dart b/pkg/front_end/test/standard_file_system_test.dart
index 3769878..c22913c 100644
--- a/pkg/front_end/test/standard_file_system_test.dart
+++ b/pkg/front_end/test/standard_file_system_test.dart
@@ -49,16 +49,16 @@
expect(dir == entityForPath(p.join(tempPath, 'dir')), isTrue);
}
- void test_exists_directoryExists() async {
+ Future<void> test_exists_directoryExists() async {
await new io.Directory(path).create();
expect(await dir.exists(), isTrue);
}
- void test_exists_doesNotExist() async {
+ Future<void> test_exists_doesNotExist() async {
expect(await dir.exists(), isFalse);
}
- void test_readAsBytes() async {
+ Future<void> test_readAsBytes() async {
await new io.Directory(path).create();
await expectLater(dir.readAsBytes, _throwsFileSystemException);
}
@@ -88,11 +88,11 @@
expect(file == entityForPath(p.join(tempPath, 'file.txt')), isTrue);
}
- void test_exists_doesNotExist() async {
+ Future<void> test_exists_doesNotExist() async {
expect(await file.exists(), isFalse);
}
- void test_exists_fileExists() async {
+ Future<void> test_exists_fileExists() async {
new io.File(path).writeAsStringSync('contents');
expect(await file.exists(), isTrue);
}
@@ -101,39 +101,39 @@
expect(file.hashCode, entityForPath(p.join(tempPath, 'file.txt')).hashCode);
}
- void test_readAsBytes_badUtf8() async {
+ Future<void> test_readAsBytes_badUtf8() async {
// A file containing invalid UTF-8 can still be read as raw bytes.
List<int> bytes = [0xc0, 0x40]; // Invalid UTF-8
new io.File(path).writeAsBytesSync(bytes);
expect(await file.readAsBytes(), bytes);
}
- void test_readAsBytes_doesNotExist() async {
+ Future<void> test_readAsBytes_doesNotExist() async {
await expectLater(file.readAsBytes, _throwsFileSystemException);
}
- void test_readAsBytes_exists() async {
+ Future<void> test_readAsBytes_exists() async {
var s = 'contents';
new io.File(path).writeAsStringSync(s);
expect(await file.readAsBytes(), utf8.encode(s));
}
- void test_readAsString_badUtf8() async {
+ Future<void> test_readAsString_badUtf8() async {
new io.File(path).writeAsBytesSync([0xc0, 0x40]); // Invalid UTF-8
await expectLater(file.readAsString, _throwsFileSystemException);
}
- void test_readAsString_doesNotExist() async {
+ Future<void> test_readAsString_doesNotExist() async {
await expectLater(file.readAsString, _throwsFileSystemException);
}
- void test_readAsString_exists() async {
+ Future<void> test_readAsString_exists() async {
var s = 'contents';
new io.File(path).writeAsStringSync(s);
expect(await file.readAsString(), s);
}
- void test_readAsString_utf8() async {
+ Future<void> test_readAsString_utf8() async {
var bytes = [0xe2, 0x82, 0xac]; // Unicode € symbol (in UTF-8)
new io.File(path).writeAsBytesSync(bytes);
expect(await file.readAsString(), '\u20ac');
@@ -206,7 +206,7 @@
}
}
- void test_entityForUri_nonFileUri() async {
+ Future<void> test_entityForUri_nonFileUri() async {
await expectLater(
() => StandardFileSystem.instance
.entityForUri(Uri.parse('package:foo/bar.dart')),
@@ -242,7 +242,7 @@
tempPath = tempDirectory.absolute.path;
}
- void tearDown() async {
+ Future<void> tearDown() async {
try {
tempDirectory.deleteSync(recursive: true);
} on io.FileSystemException {
@@ -257,7 +257,7 @@
@reflectiveTest
class DataTest {
- void test_Data_URIs() async {
+ Future<void> test_Data_URIs() async {
String string = "<{[DART]}>";
Uri string_uri = new Uri.dataFromString(string, base64: false);
Uri string_uri_base64 = new Uri.dataFromString(string, base64: true);
diff --git a/pkg/front_end/test/static_types/analysis_helper.dart b/pkg/front_end/test/static_types/analysis_helper.dart
index 6b41b38..cdfdfcc 100644
--- a/pkg/front_end/test/static_types/analysis_helper.dart
+++ b/pkg/front_end/test/static_types/analysis_helper.dart
@@ -22,7 +22,7 @@
import 'package:kernel/core_types.dart';
import 'package:kernel/type_environment.dart';
-void run(Uri entryPoint, String allowedListPath,
+Future<void> run(Uri entryPoint, String allowedListPath,
{bool verbose = false,
bool generate = false,
bool analyzedUrisFilter(Uri uri)}) async {
diff --git a/pkg/front_end/test/static_types/cfe_dynamic_test.dart b/pkg/front_end/test/static_types/cfe_dynamic_test.dart
index cda9ff6..ff5e01c 100644
--- a/pkg/front_end/test/static_types/cfe_dynamic_test.dart
+++ b/pkg/front_end/test/static_types/cfe_dynamic_test.dart
@@ -21,7 +21,7 @@
return false;
}
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
await run(Uri.base.resolve('pkg/front_end/tool/_fasta/compile.dart'),
'pkg/front_end/test/static_types/cfe_allowed.json',
analyzedUrisFilter: cfeOnly,
diff --git a/pkg/front_end/test/static_types/static_type_test.dart b/pkg/front_end/test/static_types/static_type_test.dart
index 7c2d21e..0f168be 100644
--- a/pkg/front_end/test/static_types/static_type_test.dart
+++ b/pkg/front_end/test/static_types/static_type_test.dart
@@ -12,7 +12,7 @@
import 'package:kernel/ast.dart';
import 'package:kernel/type_environment.dart';
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await runTests<String>(dataDir,
args: args,
diff --git a/pkg/front_end/test/test_generator_test.dart b/pkg/front_end/test/test_generator_test.dart
index f873a70..23c8f54 100644
--- a/pkg/front_end/test/test_generator_test.dart
+++ b/pkg/front_end/test/test_generator_test.dart
@@ -17,7 +17,7 @@
import 'incremental_suite.dart' as helper;
-void main() async {
+Future<void> main() async {
CompilerAndOptions compilerAndOptions = TestCompiler.initialize();
TestCompiler compiler = compilerAndOptions.compiler;
bool hasNewline = true;
diff --git a/pkg/front_end/test/text_representation/text_representation_test.dart b/pkg/front_end/test/text_representation/text_representation_test.dart
index ba24ec6..883ac09 100644
--- a/pkg/front_end/test/text_representation/text_representation_test.dart
+++ b/pkg/front_end/test/text_representation/text_representation_test.dart
@@ -64,7 +64,7 @@
throw new UnsupportedError("Unexpected marker '${marker}'.");
}
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await runTests<String>(dataDir,
args: args,
diff --git a/pkg/front_end/test/tool/reload.dart b/pkg/front_end/test/tool/reload.dart
index 7b783bc..40a94a5 100644
--- a/pkg/front_end/test/tool/reload.dart
+++ b/pkg/front_end/test/tool/reload.dart
@@ -107,7 +107,7 @@
/// launched with `--observe` to enable the service protocol.
///
// TODO(sigmund): provide flags to configure the vm-service port.
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
if (args.length == 0) {
print('usage: reload <entry-uri>');
return;
diff --git a/pkg/front_end/test/unit_test_suites_impl.dart b/pkg/front_end/test/unit_test_suites_impl.dart
index bd7f75f..3376bd2 100644
--- a/pkg/front_end/test/unit_test_suites_impl.dart
+++ b/pkg/front_end/test/unit_test_suites_impl.dart
@@ -495,7 +495,7 @@
);
}
-void runSuite(SuiteConfiguration configuration) async {
+Future<void> runSuite(SuiteConfiguration configuration) async {
Suite suite = configuration.suite;
String name = suite.prefix;
String fullSuiteName = "$suiteNamePrefix/$name";
@@ -531,7 +531,7 @@
await File.fromUri(uri).writeAsString(lines.map((line) => "$line\n").join());
}
-void main([List<String> arguments = const <String>[]]) async {
+Future<void> main([List<String> arguments = const <String>[]]) async {
Stopwatch totalRuntime = new Stopwatch()..start();
List<String> results = [];
diff --git a/pkg/front_end/test/vm_service_coverage.dart b/pkg/front_end/test/vm_service_coverage.dart
index 31e61fe..0d4768a 100644
--- a/pkg/front_end/test/vm_service_coverage.dart
+++ b/pkg/front_end/test/vm_service_coverage.dart
@@ -8,7 +8,7 @@
import 'vm_service_helper.dart' as vmService;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
CoverageHelper coverageHelper = new CoverageHelper();
List<String> allArgs = <String>[];
@@ -19,7 +19,7 @@
]);
allArgs.addAll(args);
- coverageHelper.start(allArgs);
+ await coverageHelper.start(allArgs);
}
class CoverageHelper extends vmService.LaunchingVMServiceHelper {
diff --git a/pkg/front_end/test/vm_service_coverage_constant_evaluator.dart b/pkg/front_end/test/vm_service_coverage_constant_evaluator.dart
index 1fed414..56b167b 100644
--- a/pkg/front_end/test/vm_service_coverage_constant_evaluator.dart
+++ b/pkg/front_end/test/vm_service_coverage_constant_evaluator.dart
@@ -6,7 +6,7 @@
import 'vm_service_coverage.dart' as helper;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
CoverageHelper coverageHelper = new CoverageHelper();
List<String> allArgs = <String>[];
@@ -17,7 +17,7 @@
]);
allArgs.addAll(args);
- coverageHelper.start(allArgs);
+ await coverageHelper.start(allArgs);
}
class CoverageHelper extends helper.CoverageHelper {
diff --git a/pkg/front_end/test/vm_service_for_leak_detection.dart b/pkg/front_end/test/vm_service_for_leak_detection.dart
index bae1839..e5782a8 100644
--- a/pkg/front_end/test/vm_service_for_leak_detection.dart
+++ b/pkg/front_end/test/vm_service_for_leak_detection.dart
@@ -8,7 +8,7 @@
import "vm_service_heap_helper.dart" as helper;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
List<helper.Interest> interests = <helper.Interest>[];
interests.add(new helper.Interest(
Uri.parse("package:front_end/src/fasta/source/source_library_builder.dart"),
@@ -45,7 +45,7 @@
);
if (args.length > 0 && args[0] == "--dart2js") {
- heapHelper.start([
+ await heapHelper.start([
"--enable-asserts",
Platform.script.resolve("incremental_dart2js_tester.dart").toString(),
"--addDebugBreaks",
@@ -53,13 +53,13 @@
"--experimental",
]);
} else if (args.length > 0 && args[0] == "--weekly") {
- heapHelper.start([
+ await heapHelper.start([
"--enable-asserts",
Platform.script.resolve("incremental_suite.dart").toString(),
"-DaddDebugBreaks=true",
]);
} else {
- heapHelper.start([
+ await heapHelper.start([
"--enable-asserts",
Platform.script.resolve("incremental_suite.dart").toString(),
"-DaddDebugBreaks=true",
diff --git a/pkg/front_end/test/vm_service_heap_finder.dart b/pkg/front_end/test/vm_service_heap_finder.dart
index 13f18fc..a098317 100644
--- a/pkg/front_end/test/vm_service_heap_finder.dart
+++ b/pkg/front_end/test/vm_service_heap_finder.dart
@@ -15,7 +15,7 @@
Foo(this.x, this.y);
}
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
String connectTo;
String classToFind;
String whatToDo;
diff --git a/pkg/front_end/test/vm_service_heap_helper.dart b/pkg/front_end/test/vm_service_heap_helper.dart
index d7bf8d0..ac5e8d9 100644
--- a/pkg/front_end/test/vm_service_heap_helper.dart
+++ b/pkg/front_end/test/vm_service_heap_helper.dart
@@ -50,7 +50,7 @@
}
}
- void pause() async {
+ Future<void> pause() async {
await serviceClient.pause(_isolateRef.id);
}
diff --git a/pkg/front_end/test/vm_service_heap_helper_test.dart b/pkg/front_end/test/vm_service_heap_helper_test.dart
index 470e114..8a7df50 100644
--- a/pkg/front_end/test/vm_service_heap_helper_test.dart
+++ b/pkg/front_end/test/vm_service_heap_helper_test.dart
@@ -49,7 +49,7 @@
throwOnPossibleLeak: false,
);
- heapHelper.start(
+ await heapHelper.start(
[
"--enable-asserts",
Platform.script.toString(),
diff --git a/pkg/front_end/test/vm_service_helper.dart b/pkg/front_end/test/vm_service_helper.dart
index f5adc3f..c796b41 100644
--- a/pkg/front_end/test/vm_service_helper.dart
+++ b/pkg/front_end/test/vm_service_helper.dart
@@ -155,7 +155,7 @@
bool _started = false;
- void start(List<String> scriptAndArgs,
+ Future<void> start(List<String> scriptAndArgs,
{void stdoutReceiver(String line),
void stderrReceiver(String line)}) async {
if (_started) throw "Already started";
diff --git a/pkg/front_end/test/weekly_tester.dart b/pkg/front_end/test/weekly_tester.dart
index 6cdd65a..2fe9bbf 100644
--- a/pkg/front_end/test/weekly_tester.dart
+++ b/pkg/front_end/test/weekly_tester.dart
@@ -6,7 +6,7 @@
import 'dart:convert' show LineSplitter, utf8;
import 'dart:io' show File, Platform, Process, exitCode;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
// General idea: Launch - in separate processes - whatever we want to run
// concurrently, capturing the stdout and stderr, printing it with some
// prepended identification.
diff --git a/pkg/front_end/tool/_fasta/abcompile.dart b/pkg/front_end/tool/_fasta/abcompile.dart
index 26ad63a..2978ee2 100644
--- a/pkg/front_end/tool/_fasta/abcompile.dart
+++ b/pkg/front_end/tool/_fasta/abcompile.dart
@@ -18,7 +18,7 @@
/// by alternately launching the compile application in this directory
/// and the compile application location in the repo specified by "bRoot"
/// via -DbRoot=/absolute/path/to/other/sdk/repo
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
print(args);
if (bRootPath == null) {
print('Expected -DbRoot=/absolute/path/to/other/sdk/repo');
diff --git a/pkg/front_end/tool/_fasta/entry_points.dart b/pkg/front_end/tool/_fasta/entry_points.dart
index f729ad1..6d05e95 100644
--- a/pkg/front_end/tool/_fasta/entry_points.dart
+++ b/pkg/front_end/tool/_fasta/entry_points.dart
@@ -86,7 +86,7 @@
}
}
-void outlineEntryPoint(List<String> arguments) async {
+Future<void> outlineEntryPoint(List<String> arguments) async {
installAdditionalTargets();
for (int i = 0; i < iterations; i++) {
@@ -97,7 +97,7 @@
}
}
-void depsEntryPoint(List<String> arguments) async {
+Future<void> depsEntryPoint(List<String> arguments) async {
installAdditionalTargets();
for (int i = 0; i < iterations; i++) {
@@ -108,7 +108,7 @@
}
}
-void compilePlatformEntryPoint(List<String> arguments) async {
+Future<void> compilePlatformEntryPoint(List<String> arguments) async {
installAdditionalTargets();
for (int i = 0; i < iterations; i++) {
if (i > 0) {
@@ -118,7 +118,7 @@
}
}
-void batchEntryPoint(List<String> arguments) {
+Future<void> batchEntryPoint(List<String> arguments) {
installAdditionalTargets();
return new BatchCompiler(
stdin.transform(utf8.decoder).transform(new LineSplitter()))
@@ -136,7 +136,7 @@
BatchCompiler(this.lines);
- void run() async {
+ Future<void> run() async {
await for (String line in lines) {
try {
if (await batchCompileArguments(
@@ -207,7 +207,7 @@
}
}
-void incrementalEntryPoint(List<String> arguments) async {
+Future<void> incrementalEntryPoint(List<String> arguments) async {
installAdditionalTargets();
await withGlobalOptions("incremental", arguments, true,
(CompilerContext c, _) {
diff --git a/pkg/front_end/tool/_fasta/log_analyzer.dart b/pkg/front_end/tool/_fasta/log_analyzer.dart
index 1fdbc7a..430b50b 100644
--- a/pkg/front_end/tool/_fasta/log_analyzer.dart
+++ b/pkg/front_end/tool/_fasta/log_analyzer.dart
@@ -8,7 +8,7 @@
import 'package:testing/src/run_tests.dart' show CommandLine;
-void main(List<String> arguments) async {
+Future<void> main(List<String> arguments) async {
CommandLine cl = CommandLine.parse(arguments);
Set<String> fields = cl.commaSeparated("--fields=");
if (fields.isEmpty) {
diff --git a/pkg/front_end/tool/_fasta/log_collector.dart b/pkg/front_end/tool/_fasta/log_collector.dart
index 3b0c717..c82af8f 100644
--- a/pkg/front_end/tool/_fasta/log_collector.dart
+++ b/pkg/front_end/tool/_fasta/log_collector.dart
@@ -30,7 +30,7 @@
print("${request.uri}: $message");
}
-void collectLog(DateTime time, HttpRequest request) async {
+Future<void> collectLog(DateTime time, HttpRequest request) async {
String json = await request.cast<List<int>>().transform(utf8.decoder).join();
var data;
try {
@@ -81,7 +81,7 @@
""");
}
-void main(List<String> arguments) async {
+Future<void> main(List<String> arguments) async {
RawReceivePort keepAlive = new RawReceivePort();
Uri uri;
if (arguments.length == 1) {
@@ -104,7 +104,7 @@
badRequest(request, HttpStatus.notFound, "Not found.");
continue;
}
- collectLog(new DateTime.now(), request);
+ await collectLog(new DateTime.now(), request);
}
keepAlive.close();
}
diff --git a/pkg/front_end/tool/fasta_perf_test.dart b/pkg/front_end/tool/fasta_perf_test.dart
index 1671627..1d561b8 100644
--- a/pkg/front_end/tool/fasta_perf_test.dart
+++ b/pkg/front_end/tool/fasta_perf_test.dart
@@ -9,7 +9,7 @@
import 'dart:io' show Platform;
import 'fasta_perf.dart' as m show main;
-void main() async {
+Future<void> main() async {
var benchIds = [
'scan',
'kernel_gen_e2e',
diff --git a/pkg/front_end/tool/generate_ast_coverage.dart b/pkg/front_end/tool/generate_ast_coverage.dart
index 516d5e1..d3a299b 100644
--- a/pkg/front_end/tool/generate_ast_coverage.dart
+++ b/pkg/front_end/tool/generate_ast_coverage.dart
@@ -13,7 +13,7 @@
return repoDir.resolve('pkg/kernel/lib/src/coverage.dart');
}
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Uri output = args.isEmpty
? computeCoverageUri(Uri.base)
: new File(args[0]).absolute.uri;
diff --git a/pkg/front_end/tool/generate_ast_equivalence.dart b/pkg/front_end/tool/generate_ast_equivalence.dart
index 5a0c02b..beea310 100644
--- a/pkg/front_end/tool/generate_ast_equivalence.dart
+++ b/pkg/front_end/tool/generate_ast_equivalence.dart
@@ -11,7 +11,7 @@
return repoDir.resolve('pkg/kernel/lib/src/equivalence.dart');
}
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Uri output = args.isEmpty
? computeEquivalenceUri(Uri.base)
: new File(args[0]).absolute.uri;
diff --git a/pkg/front_end/tool/incremental_perf_test.dart b/pkg/front_end/tool/incremental_perf_test.dart
index d24c01a..1be785ef 100644
--- a/pkg/front_end/tool/incremental_perf_test.dart
+++ b/pkg/front_end/tool/incremental_perf_test.dart
@@ -9,7 +9,7 @@
show computePlatformBinariesLocation;
import 'incremental_perf.dart' as m show main;
-void main() async {
+Future<void> main() async {
var sdkOutline = computePlatformBinariesLocation(forceBuildDir: true).resolve(
// TODO(sigmund): switch to `vm_outline.dill` (issue #29881).
"vm_platform_strong.dill");
diff --git a/pkg/front_end/tool/perf_test.dart b/pkg/front_end/tool/perf_test.dart
index 495c9fb..6667553 100644
--- a/pkg/front_end/tool/perf_test.dart
+++ b/pkg/front_end/tool/perf_test.dart
@@ -7,7 +7,7 @@
import 'dart:io' show Platform;
import 'perf.dart' as m;
-void main() async {
+Future<void> main() async {
var benchIds = ['scan', 'parse'];
var inputFile =
Platform.script.resolve('../lib/src/api_prototype/file_system.dart').path;
diff --git a/pkg/front_end/tool/smoke_test_quick.dart b/pkg/front_end/tool/smoke_test_quick.dart
index b6d94f8..12b77c3 100644
--- a/pkg/front_end/tool/smoke_test_quick.dart
+++ b/pkg/front_end/tool/smoke_test_quick.dart
@@ -10,7 +10,7 @@
String get dartVm => Platform.executable;
-void main(List<String> args) async {
+Future<void> main(List<String> args) async {
Stopwatch stopwatch = new Stopwatch()..start();
List<Future> futures = <Future>[];
futures.add(run("pkg/front_end/test/explicit_creation_git_test.dart",
diff --git a/pkg/front_end/tool/update_all.dart b/pkg/front_end/tool/update_all.dart
index e32686e..bffcf9f 100644
--- a/pkg/front_end/tool/update_all.dart
+++ b/pkg/front_end/tool/update_all.dart
@@ -23,7 +23,7 @@
'pkg/front_end/test/static_types/static_type_test.dart',
];
-void main() async {
+Future<void> main() async {
// Update all tests based on expectation files.
await expectations.main(const <String>[]);
diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md
index ab32dae..1a0a3a2 100644
--- a/pkg/kernel/binary.md
+++ b/pkg/kernel/binary.md
@@ -147,7 +147,7 @@
type ComponentFile {
UInt32 magic = 0x90ABCDEF;
- UInt32 formatVersion = 71;
+ UInt32 formatVersion = 72;
Byte[10] shortSdkHash;
List<String> problemsAsJson; // Described in problems.md.
Library[] libraries;
@@ -346,6 +346,10 @@
Byte flags (isExtensionTypeDeclaration);
List<TypeParameter> typeParameters;
DartType onType;
+ Option<ExtensionTypeShowHideClause> showHideClause;
+}
+
+type ExtensionTypeShowHideClause {
List<DartType> shownSupertypes;
List<CanonicalNameReference> shownMembers;
List<CanonicalNameReference> shownGetters;
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
index 14eb7b8..1423d0d 100644
--- a/pkg/kernel/lib/binary/ast_from_binary.dart
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -529,14 +529,15 @@
growable: useGrowableLists);
}
- List<Reference> readNonNullReferenceList() {
+ List<Reference> readNonNullReferenceList(List<Reference> result) {
int length = readUInt30();
if (!useGrowableLists && length == 0) {
return emptyListOfReference;
}
- return new List<Reference>.generate(
- length, (_) => readNonNullMemberReference(),
- growable: useGrowableLists);
+ for (int i = 0; i < length; ++i) {
+ result.add(readNonNullMemberReference());
+ }
+ return result;
}
String? readStringOrNullIfEmpty() {
@@ -1458,32 +1459,27 @@
readAndPushTypeParameterList(node.typeParameters, node);
DartType onType = readDartType();
- List<Supertype> shownSupertypes = readSupertypeList();
- List<Reference> shownMembers = readNonNullReferenceList();
- List<Reference> shownGetters = readNonNullReferenceList();
- List<Reference> shownSetters = readNonNullReferenceList();
- List<Reference> shownOperators = readNonNullReferenceList();
- List<Supertype> hiddenSupertypes = readSupertypeList();
- List<Reference> hiddenMembers = readNonNullReferenceList();
- List<Reference> hiddenGetters = readNonNullReferenceList();
- List<Reference> hiddenSetters = readNonNullReferenceList();
- List<Reference> hiddenOperators = readNonNullReferenceList();
+
+ if (readAndCheckOptionTag()) {
+ ExtensionTypeShowHideClause showHideClause =
+ node.showHideClause = new ExtensionTypeShowHideClause();
+ readSupertypeList(showHideClause.shownSupertypes);
+ readNonNullReferenceList(showHideClause.shownMethods);
+ readNonNullReferenceList(showHideClause.shownGetters);
+ readNonNullReferenceList(showHideClause.shownSetters);
+ readNonNullReferenceList(showHideClause.shownOperators);
+ readSupertypeList(showHideClause.hiddenSupertypes);
+ readNonNullReferenceList(showHideClause.hiddenMethods);
+ readNonNullReferenceList(showHideClause.hiddenGetters);
+ readNonNullReferenceList(showHideClause.hiddenSetters);
+ readNonNullReferenceList(showHideClause.hiddenOperators);
+ }
+
typeParameterStack.length = 0;
node.name = name;
node.fileUri = fileUri;
node.onType = onType;
- node.showHideClause = new ExtensionTypeShowHideClause()
- ..shownSupertypes.addAll(shownSupertypes)
- ..shownMethods.addAll(shownMembers)
- ..shownGetters.addAll(shownGetters)
- ..shownSetters.addAll(shownSetters)
- ..shownOperators.addAll(shownOperators)
- ..hiddenSupertypes.addAll(hiddenSupertypes)
- ..hiddenMethods.addAll(hiddenMembers)
- ..hiddenGetters.addAll(hiddenGetters)
- ..hiddenSetters.addAll(hiddenSetters)
- ..hiddenOperators.addAll(hiddenOperators);
node.members = _readExtensionMemberDescriptorList();
@@ -2949,15 +2945,22 @@
return readAndCheckOptionTag() ? readSupertype() : null;
}
- List<Supertype> readSupertypeList() {
+ List<Supertype> readSupertypeList([List<Supertype>? result]) {
int length = readUInt30();
if (!useGrowableLists && length == 0) {
// When lists don't have to be growable anyway, we might as well use an
// almost constant one for the empty list.
return emptyListOfSupertype;
}
- return new List<Supertype>.generate(length, (_) => readSupertype(),
- growable: useGrowableLists);
+ if (result != null) {
+ for (int i = 0; i < length; ++i) {
+ result.add(readSupertype());
+ }
+ return result;
+ } else {
+ return new List<Supertype>.generate(length, (_) => readSupertype(),
+ growable: useGrowableLists);
+ }
}
List<DartType> readDartTypeList() {
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
index b0de73c..6cb1bd7 100644
--- a/pkg/kernel/lib/binary/ast_to_binary.dart
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -2451,18 +2451,24 @@
enterScope(typeParameters: node.typeParameters);
writeNodeList(node.typeParameters);
writeDartType(node.onType);
- ExtensionTypeShowHideClause showHideClause =
- node.showHideClause ?? new ExtensionTypeShowHideClause();
- writeNodeList(showHideClause.shownSupertypes);
- writeList(showHideClause.shownMethods, writeNonNullReference);
- writeList(showHideClause.shownGetters, writeNonNullReference);
- writeList(showHideClause.shownSetters, writeNonNullReference);
- writeList(showHideClause.shownOperators, writeNonNullReference);
- writeNodeList(showHideClause.hiddenSupertypes);
- writeList(showHideClause.hiddenMethods, writeNonNullReference);
- writeList(showHideClause.hiddenGetters, writeNonNullReference);
- writeList(showHideClause.hiddenSetters, writeNonNullReference);
- writeList(showHideClause.hiddenOperators, writeNonNullReference);
+
+ ExtensionTypeShowHideClause? showHideClause = node.showHideClause;
+ if (showHideClause == null) {
+ writeByte(Tag.Nothing);
+ } else {
+ writeByte(Tag.Something);
+ writeNodeList(showHideClause.shownSupertypes);
+ writeList(showHideClause.shownMethods, writeNonNullReference);
+ writeList(showHideClause.shownGetters, writeNonNullReference);
+ writeList(showHideClause.shownSetters, writeNonNullReference);
+ writeList(showHideClause.shownOperators, writeNonNullReference);
+ writeNodeList(showHideClause.hiddenSupertypes);
+ writeList(showHideClause.hiddenMethods, writeNonNullReference);
+ writeList(showHideClause.hiddenGetters, writeNonNullReference);
+ writeList(showHideClause.hiddenSetters, writeNonNullReference);
+ writeList(showHideClause.hiddenOperators, writeNonNullReference);
+ }
+
leaveScope(typeParameters: node.typeParameters);
final int len = node.members.length;
diff --git a/pkg/kernel/lib/binary/tag.dart b/pkg/kernel/lib/binary/tag.dart
index 2fe1841..b628f87 100644
--- a/pkg/kernel/lib/binary/tag.dart
+++ b/pkg/kernel/lib/binary/tag.dart
@@ -176,7 +176,7 @@
/// Internal version of kernel binary format.
/// Bump it when making incompatible changes in kernel binaries.
/// Keep in sync with runtime/vm/kernel_binary.h, pkg/kernel/binary.md.
- static const int BinaryFormatVersion = 71;
+ static const int BinaryFormatVersion = 72;
}
abstract class ConstantTag {
diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h
index 653c0fd..13f777c 100644
--- a/runtime/vm/kernel_binary.h
+++ b/runtime/vm/kernel_binary.h
@@ -20,8 +20,8 @@
static const uint32_t kMagicProgramFile = 0x90ABCDEFu;
// Both version numbers are inclusive.
-static const uint32_t kMinSupportedKernelFormatVersion = 71;
-static const uint32_t kMaxSupportedKernelFormatVersion = 71;
+static const uint32_t kMinSupportedKernelFormatVersion = 72;
+static const uint32_t kMaxSupportedKernelFormatVersion = 72;
// Keep in sync with package:kernel/lib/binary/tag.dart
#define KERNEL_TAG_LIST(V) \
diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc
index 6efc565..6236cf3 100644
--- a/runtime/vm/kernel_loader.cc
+++ b/runtime/vm/kernel_loader.cc
@@ -1089,16 +1089,19 @@
helper_.ReadByte(); // skip flags.
helper_.SkipTypeParametersList(); // skip type parameter list.
helper_.SkipDartType(); // skip on-type.
- helper_.SkipListOfDartTypes(); // skip shown types.
- helper_.SkipListOfCanonicalNameReferences(); // skip shown members.
- helper_.SkipListOfCanonicalNameReferences(); // skip shown getters.
- helper_.SkipListOfCanonicalNameReferences(); // skip shown setters.
- helper_.SkipListOfCanonicalNameReferences(); // skip shown operators.
- helper_.SkipListOfDartTypes(); // skip hidden types.
- helper_.SkipListOfCanonicalNameReferences(); // skip hidden members.
- helper_.SkipListOfCanonicalNameReferences(); // skip hidden getters.
- helper_.SkipListOfCanonicalNameReferences(); // skip hidden setters.
- helper_.SkipListOfCanonicalNameReferences(); // skip hidden operators.
+ Tag tag = helper_.ReadTag();
+ if (tag != kNothing) {
+ helper_.SkipListOfDartTypes(); // skip shown types.
+ helper_.SkipListOfCanonicalNameReferences(); // skip shown members.
+ helper_.SkipListOfCanonicalNameReferences(); // skip shown getters.
+ helper_.SkipListOfCanonicalNameReferences(); // skip shown setters.
+ helper_.SkipListOfCanonicalNameReferences(); // skip shown operators.
+ helper_.SkipListOfDartTypes(); // skip hidden types.
+ helper_.SkipListOfCanonicalNameReferences(); // skip hidden members.
+ helper_.SkipListOfCanonicalNameReferences(); // skip hidden getters.
+ helper_.SkipListOfCanonicalNameReferences(); // skip hidden setters.
+ helper_.SkipListOfCanonicalNameReferences(); // skip hidden operators.
+ }
const intptr_t extension_member_count = helper_.ReadListLength();
for (intptr_t j = 0; j < extension_member_count; ++j) {
diff --git a/tools/VERSION b/tools/VERSION
index b752d93..aa58cf1 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 15
PATCH 0
-PRERELEASE 140
+PRERELEASE 141
PRERELEASE_PATCH 0
\ No newline at end of file