From 8a883fa54d155bafe0520f359267ff5f5b09f189 Mon Sep 17 00:00:00 2001 From: "Lasse R.H. Nielsen" Date: Wed, 24 Aug 2022 15:57:16 +0000 Subject: [PATCH] Change `:` to `=` for default values in `pkg`. Leaves some in parser test: pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart TEST=Refactoring, covered by existing tests. Change-Id: I7a83ef95df3cbd283878b3685b5c747bd89a1b16 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256125 Reviewed-by: Johnni Winther Commit-Queue: Lasse Nielsen --- .../lib/src/base/errors.dart | 2 +- .../lib/src/flow_analysis/flow_analysis.dart | 2 +- .../lib/src/messages/codes.dart | 2 +- .../lib/src/parser/identifier_context.dart | 14 +- .../lib/src/parser/parser.dart | 2 +- .../lib/src/parser/parser_impl.dart | 2 +- .../lib/src/parser/stack_listener.dart | 2 +- .../lib/src/scanner/io.dart | 2 +- .../lib/src/scanner/scanner.dart | 4 +- .../lib/src/scanner/scanner_main.dart | 3 +- .../lib/src/scanner/string_scanner.dart | 2 +- .../lib/src/scanner/token.dart | 18 +- .../lib/src/scanner/token_impl.dart | 6 +- .../lib/src/scanner/utf8_bytes_scanner.dart | 2 +- .../lib/src/testing/features.dart | 2 +- .../lib/src/testing/id.dart | 10 +- .../lib/src/testing/id_generation.dart | 18 +- .../lib/src/testing/id_testing.dart | 29 +- .../type_inference/assigned_variables.dart | 4 +- .../lib/src/util/libraries_specification.dart | 2 +- .../lib/src/util/link.dart | 4 +- .../lib/src/util/options.dart | 2 +- .../test/id_generation_test.dart | 18 +- .../data/members_from_opt_in/main.dart | 4 +- .../data/members_from_opt_in/opt_in.dart | 8 +- .../data/members_from_opt_out/main.dart | 8 +- .../macros/api/api_test_expectations.dart | 60 ++-- .../tool/smoke_test_quick.dart | 2 +- pkg/compiler/lib/src/inferrer/builder.dart | 2 +- .../test/annotations/annotations_test.dart | 2 +- pkg/compiler/test/closure/closure_test.dart | 4 +- .../test/codegen/codegen_test_helper.dart | 2 +- .../test/codegen/expect_annotations_test.dart | 8 +- .../test/codegen/late_field_test.dart | 2 +- .../effectively_constant_state.dart | 2 +- pkg/compiler/test/codegen/model_test.dart | 2 +- .../test/codegen/pragma_annotations_test.dart | 2 +- .../test/codegen/string_reference_test.dart | 2 +- .../data/instantiation0/lib1.dart | 2 +- .../data/instantiation1/lib1.dart | 2 +- .../data/instantiation1/lib2.dart | 2 +- .../data/instantiation2/lib1.dart | 2 +- .../data/instantiation2/lib2.dart | 2 +- .../deferred_loading_test_helper.dart | 4 +- .../dump_info_new_regression_test.dart | 4 +- .../test/dump_info/dump_info_new_test.dart | 4 +- .../test/dump_info/dump_info_test.dart | 4 +- .../test/end_to_end/dump_info2_test.dart | 2 +- .../test/end_to_end/exit_code_test.dart | 2 +- .../test/end_to_end/launch_helper.dart | 2 +- .../test/end_to_end/modular_loader_test.dart | 2 +- .../test/end_to_end/output_type_test.dart | 2 +- .../test/end_to_end/user_crash_test.dart | 4 +- .../test/equivalence/check_helpers.dart | 26 +- .../equivalence/id_equivalence_helper.dart | 40 +-- .../test/equivalence/id_testing_test.dart | 2 +- .../test/equivalence/show_helper.dart | 2 +- .../field_analysis/jdata/constant_fields.dart | 6 +- .../jdata/effectively_constant_state.dart | 2 +- .../field_analysis/jfield_analysis_test.dart | 2 +- .../field_analysis/kdata/constant_fields.dart | 6 +- .../field_analysis/kfield_analysis_test.dart | 2 +- .../function_type_variable_test.dart | 2 +- .../test/helpers/compiler_helper.dart | 24 +- pkg/compiler/test/helpers/d8_helper.dart | 10 +- pkg/compiler/test/helpers/element_lookup.dart | 2 +- .../test/helpers/memory_compiler.dart | 18 +- .../helpers/memory_source_file_helper.dart | 2 +- pkg/compiler/test/helpers/text_helpers.dart | 2 +- .../test/helpers/type_test_helper.dart | 18 +- .../test/impact/data/initializers.dart | 2 +- pkg/compiler/test/impact/impact_test.dart | 2 +- pkg/compiler/test/inference/callers_test.dart | 2 +- .../inference/data/const_closure_default.dart | 6 +- .../lib.dart | 2 +- pkg/compiler/test/inference/data/static.dart | 4 +- .../test/inference/inference_data_test.dart | 2 +- .../test/inference/inference_test_helper.dart | 2 +- .../inference/load_deferred_library_test.dart | 2 +- .../test/inference/side_effects_test.dart | 2 +- .../inference/type_mask_disjoint_test.dart | 6 +- .../test/inference/type_mask_test_helper.dart | 2 +- pkg/compiler/test/inlining/inlining_test.dart | 2 +- .../test/inlining/meta_annotations_test.dart | 2 +- pkg/compiler/test/js/js_safety_test.dart | 2 +- pkg/compiler/test/js/js_spec_string_test.dart | 4 +- .../test/jsinterop/declaration_test.dart | 8 +- .../jsinterop/internal_annotations_test.dart | 6 +- pkg/compiler/test/jsinterop/world_test.dart | 6 +- pkg/compiler/test/jumps/jump_test.dart | 2 +- .../test/member_usage/member_usage_test.dart | 2 +- .../test/model/call_structure_namer_test.dart | 6 +- .../test/model/cfe_constant_test.dart | 2 +- pkg/compiler/test/model/class_set_test.dart | 11 +- pkg/compiler/test/model/native_test.dart | 6 +- .../model/no_such_method_enabled_test.dart | 16 +- .../model/no_such_method_forwarders_test.dart | 2 +- .../test/model/strong_mode_impact_test.dart | 8 +- pkg/compiler/test/model/subtypeset_test.dart | 4 +- pkg/compiler/test/model/world_test.dart | 16 +- .../test/optimization/optimization_test.dart | 6 +- .../test/rti/rti_emission_test_helper.dart | 4 +- .../test/rti/rti_need_test_helper.dart | 4 +- .../serialization/serialization_test.dart | 12 +- .../serialization_test_helper.dart | 6 +- .../test/sourcemaps/helpers/html_parts.dart | 25 +- .../sourcemaps/helpers/output_structure.dart | 2 +- .../sourcemaps/helpers/sourcemap_helper.dart | 14 +- .../helpers/sourcemap_html_helper.dart | 14 +- .../test/sourcemaps/mapping_test.dart | 2 +- .../test/sourcemaps/nomapping_test.dart | 2 +- .../sourcemaps/stacktrace/parameters.dart | 14 +- .../stacktrace/parameters_elided.dart | 14 +- .../test/sourcemaps/stacktrace_test.dart | 18 +- .../test/sourcemaps/stepping_test.dart | 8 +- .../test/sourcemaps/tools/diff_view.dart | 4 +- .../tools/source_mapping_test_viewer.dart | 2 +- .../tools/source_mapping_tester.dart | 6 +- .../test/static_type/static_type_test.dart | 2 +- .../test/static_type/type_promotion_test.dart | 2 +- .../graph_isomorphizer_test.dart | 2 +- pkg/compiler/tool/graph_isomorphizer.dart | 6 +- pkg/compiler/tool/track_memory.dart | 2 +- pkg/dart2wasm/lib/target.dart | 20 +- .../src/api_prototype/compiler_options.dart | 11 +- .../src/api_prototype/experimental_flags.dart | 6 +- .../incremental_kernel_generator.dart | 4 +- .../src/api_prototype/kernel_generator.dart | 8 +- .../src/api_prototype/summary_generator.dart | 2 +- .../lib/src/api_unstable/bazel_worker.dart | 16 +- .../lib/src/api_unstable/dart2js.dart | 6 +- pkg/front_end/lib/src/api_unstable/ddc.dart | 2 +- .../modular_incremental_compilation.dart | 14 +- pkg/front_end/lib/src/base/library_info.dart | 10 +- .../lib/src/base/processed_options.dart | 4 +- .../compute_platform_binaries_location.dart | 2 +- .../lib/src/fasta/builder/class_builder.dart | 8 +- .../fasta/builder/declaration_builder.dart | 8 +- .../src/fasta/builder/extension_builder.dart | 8 +- .../builder/formal_parameter_builder.dart | 2 +- .../invalid_type_declaration_builder.dart | 2 +- .../src/fasta/builder/library_builder.dart | 18 +- .../src/fasta/builder/named_type_builder.dart | 8 +- .../lib/src/fasta/compiler_context.dart | 2 +- .../src/fasta/dill/dill_class_builder.dart | 2 +- .../src/fasta/dill/dill_library_builder.dart | 6 +- .../lib/src/fasta/dill/dill_loader.dart | 12 +- .../lib/src/fasta/dill/dill_target.dart | 2 +- .../lib/src/fasta/get_dependencies.dart | 2 +- .../lib/src/fasta/incremental_compiler.dart | 4 +- .../lib/src/fasta/kernel/body_builder.dart | 58 ++-- .../lib/src/fasta/kernel/collections.dart | 2 +- .../kernel/combined_member_signature.dart | 2 +- .../kernel/constant_collection_builders.dart | 2 +- .../src/fasta/kernel/constant_evaluator.dart | 2 +- .../src/fasta/kernel/constant_int_folder.dart | 6 +- .../fasta/kernel/expression_generator.dart | 310 +++++++++--------- .../kernel/expression_generator_helper.dart | 24 +- .../lib/src/fasta/kernel/forest.dart | 22 +- .../kernel/hierarchy/members_builder.dart | 4 +- .../kernel/hierarchy/mixin_inferrer.dart | 2 +- .../lib/src/fasta/kernel/internal_ast.dart | 36 +- .../lib/src/fasta/kernel/kernel_helper.dart | 8 +- .../lib/src/fasta/kernel/kernel_target.dart | 4 +- .../fasta/kernel/transform_collections.dart | 15 +- .../lib/src/fasta/kernel/type_algorithms.dart | 2 +- pkg/front_end/lib/src/fasta/kernel/utils.dart | 4 +- .../lib/src/fasta/kernel/verifier.dart | 4 +- pkg/front_end/lib/src/fasta/loader.dart | 4 +- pkg/front_end/lib/src/fasta/modifier.dart | 2 +- pkg/front_end/lib/src/fasta/scope.dart | 14 +- .../lib/src/fasta/source/diet_listener.dart | 2 +- .../lib/src/fasta/source/name_scheme.dart | 4 +- .../lib/src/fasta/source/outline_builder.dart | 2 +- .../fasta/source/source_class_builder.dart | 4 +- .../fasta/source/source_field_builder.dart | 4 +- .../fasta/source/source_library_builder.dart | 18 +- .../lib/src/fasta/source/source_loader.dart | 36 +- .../source/source_procedure_builder.dart | 2 +- pkg/front_end/lib/src/fasta/ticker.dart | 2 +- .../type_inference/inference_visitor.dart | 16 +- .../inference_visitor_base.dart | 54 +-- .../type_inference/object_access_target.dart | 2 +- .../type_constraint_gatherer.dart | 4 +- .../src/fasta/type_inference/type_schema.dart | 2 +- .../type_schema_environment.dart | 18 +- .../lib/src/fasta/util/outline_extractor.dart | 4 +- .../lib/src/fasta/util/parser_ast.dart | 10 +- .../lib/src/fasta/util/textual_outline.dart | 22 +- .../lib/src/kernel_generator_impl.dart | 22 +- .../lib/src/testing/compiler_common.dart | 16 +- .../lib/src/testing/id_extractor.dart | 2 +- .../lib/src/testing/id_testing_helper.dart | 18 +- .../lib/src/testing/id_testing_utils.dart | 31 +- .../comments_on_certain_arguments_tool.dart | 2 +- pkg/front_end/test/compile_benchmark.dart | 6 +- .../crashing_test_case_minimizer_impl.dart | 10 +- .../test/fasta/assert_locations_test.dart | 4 +- pkg/front_end/test/fasta/bootstrap_test.dart | 2 +- .../test/fasta/expression_suite.dart | 2 +- .../test/fasta/incremental_expectations.dart | 2 +- .../test/fasta/parser/type_info_test.dart | 4 +- pkg/front_end/test/fasta/testing/suite.dart | 12 +- .../type_schema_environment_nnbd_test.dart | 4 +- .../test/incremental_flutter_tester.dart | 6 +- pkg/front_end/test/incremental_suite.dart | 4 +- pkg/front_end/test/parser_suite.dart | 4 +- .../data/const_constructors/patch.dart | 2 +- pkg/front_end/test/precedence_info_test.dart | 2 +- pkg/front_end/test/scanner_fasta_test.dart | 6 +- .../test/scanner_replacement_test.dart | 2 +- pkg/front_end/test/scanner_test.dart | 2 +- pkg/front_end/test/spell_checking_utils.dart | 4 +- .../text_representation/data/statements.dart | 2 +- pkg/front_end/test/unit_test_suites.dart | 2 +- pkg/front_end/test/utils/kernel_chain.dart | 2 +- pkg/front_end/test/utils/values.dart | 2 +- pkg/front_end/test/vm_service_coverage.dart | 2 +- .../test/vm_service_heap_helper.dart | 6 +- .../inferred_constructor_tear_off.dart | 2 +- ...uctor_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- .../lowering/constructor_tear_off.dart | 5 +- .../constructor_tear_off.dart.strong.expect | 24 +- ...or_tear_off.dart.strong.transformed.expect | 24 +- ...uctor_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- .../constructor_tear_off.dart.weak.expect | 24 +- ...structor_tear_off.dart.weak.modular.expect | 24 +- ...ctor_tear_off.dart.weak.transformed.expect | 24 +- .../constructor_tear_off_default_values.dart | 6 +- ...default_values.dart.textual_outline.expect | 4 +- ...alues.dart.textual_outline_modelled.expect | 4 +- .../lowering/factory_tear_off.dart | 3 +- .../factory_tear_off.dart.strong.expect | 24 +- ...ry_tear_off.dart.strong.transformed.expect | 24 +- ...ctory_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- .../factory_tear_off.dart.weak.expect | 24 +- .../factory_tear_off.dart.weak.modular.expect | 24 +- ...tory_tear_off.dart.weak.transformed.expect | 24 +- .../factory_tear_off_default_values.dart | 6 +- ...default_values.dart.textual_outline.expect | 4 +- ...alues.dart.textual_outline_modelled.expect | 4 +- .../lowering/from_dill/main.dart | 2 +- .../main.dart.textual_outline.expect | 2 +- .../main.dart.textual_outline_modelled.expect | 2 +- .../generic_constructor_tear_off.dart | 4 +- ...uctor_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- .../lowering/generic_factory_tear_off.dart | 4 +- ...ctory_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- .../generic_redirecting_factory_tear_off.dart | 4 +- ...ctory_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- .../inferred_constructor_tear_off.dart | 2 +- ...uctor_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- .../redirecting_factory_tear_off.dart | 12 +- ...ecting_factory_tear_off.dart.strong.expect | 36 +- ...ry_tear_off.dart.strong.transformed.expect | 36 +- ...ctory_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- ...irecting_factory_tear_off.dart.weak.expect | 36 +- ..._factory_tear_off.dart.weak.modular.expect | 36 +- ..._factory_tear_off.dart.weak.outline.expect | 6 +- ...tory_tear_off.dart.weak.transformed.expect | 36 +- ...cting_factory_tear_off_default_values.dart | 6 +- ...default_values.dart.textual_outline.expect | 4 +- ...alues.dart.textual_outline_modelled.expect | 4 +- ...ctory_tear_off_default_values_complex.dart | 2 +- ...values_complex.dart.textual_outline.expect | 2 +- ...mplex.dart.textual_outline_modelled.expect | 2 +- .../lowering/typedef_from.dart | 4 +- .../typedef_from.dart.textual_outline.expect | 2 +- ..._from.dart.textual_outline_modelled.expect | 2 +- .../lowering/typedef_tear_off.dart | 2 +- ...pedef_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- .../redirecting_factory_tear_off.dart | 6 +- ...ecting_factory_tear_off.dart.strong.expect | 36 +- ...ry_tear_off.dart.strong.transformed.expect | 36 +- ...ctory_tear_off.dart.textual_outline.expect | 2 +- ...r_off.dart.textual_outline_modelled.expect | 2 +- ...irecting_factory_tear_off.dart.weak.expect | 36 +- ..._factory_tear_off.dart.weak.modular.expect | 36 +- ..._factory_tear_off.dart.weak.outline.expect | 4 +- ...tory_tear_off.dart.weak.transformed.expect | 36 +- .../main.dart.weak.outline.expect | 10 +- .../dart2js/tear_off_patch/origin_lib.dart | 8 +- .../dart2js/tear_off_patch/patch_lib.dart | 6 +- .../main.dart.weak.outline.expect | 2 +- .../dartdevc/factory_patch/origin_lib.dart | 4 +- .../dartdevc/factory_patch/patch_lib.dart | 6 +- .../general/constants/issue_43431.dart | 4 +- .../issue_43431.dart.textual_outline.expect | 2 +- ...43431.dart.textual_outline_modelled.expect | 2 +- .../constants/issue_43431.dart.weak.expect | 2 +- .../issue_43431.dart.weak.modular.expect | 2 +- .../issue_43431.dart.weak.transformed.expect | 2 +- .../with_unevaluated_agnostic/various.dart | 5 +- .../various.dart.textual_outline.expect | 5 +- ...rious.dart.textual_outline_modelled.expect | 5 +- .../various.dart.weak.expect | 26 +- .../various.dart.weak.modular.expect | 26 +- .../various.dart.weak.outline.expect | 116 +++---- .../various.dart.weak.transformed.expect | 62 ++-- .../main.dart.weak.outline.expect | 2 +- .../general/constructor_patch/origin_lib.dart | 4 +- .../general/constructor_patch/patch_lib.dart | 4 +- .../general/duplicated_named_args_3.dart | 2 +- ...d_named_args_3.dart.textual_outline.expect | 2 +- ...rgs_3.dart.textual_outline_modelled.expect | 2 +- .../factory_patch/main.dart.weak.expect | 6 +- .../main.dart.weak.modular.expect | 6 +- .../main.dart.weak.outline.expect | 2 +- .../main.dart.weak.transformed.expect | 6 +- .../general/factory_patch/origin_lib.dart | 6 +- .../general/factory_patch/patch_lib.dart | 8 +- .../testcases/general/functions.dart | 2 +- .../testcases/general/issue43290.dart | 2 +- .../issue43290.dart.textual_outline.expect | 2 +- ...43290.dart.textual_outline_modelled.expect | 2 +- .../testcases/general/magic_const.dart | 2 +- .../magic_const.dart.textual_outline.expect | 2 +- ...const.dart.textual_outline_modelled.expect | 2 +- .../general/magic_const.dart.weak.expect | 24 +- .../magic_const.dart.weak.modular.expect | 24 +- .../magic_const.dart.weak.transformed.expect | 24 +- ...ixin_constructors_with_default_values.dart | 2 +- ...default_values.dart.textual_outline.expect | 2 +- ...alues.dart.textual_outline_modelled.expect | 2 +- ...ctors_with_default_values.dart.weak.expect | 6 +- ...th_default_values.dart.weak.modular.expect | 6 +- ...th_default_values.dart.weak.outline.expect | 8 +- ...efault_values.dart.weak.transformed.expect | 6 +- .../main.dart.weak.outline.expect | 10 +- .../general/tear_off_patch/origin_lib.dart | 8 +- .../general/tear_off_patch/patch_lib.dart | 6 +- .../parameter_defaults_downwards.dart | 12 +- ...ults_downwards.dart.textual_outline.expect | 2 +- ...wards.dart.textual_outline_modelled.expect | 2 +- .../inference/parameter_defaults_upwards.dart | 6 +- ...faults_upwards.dart.textual_outline.expect | 2 +- ...wards.dart.textual_outline_modelled.expect | 2 +- .../testcases/nnbd/nullable_param.dart | 2 +- ...nullable_param.dart.textual_outline.expect | 2 +- ...param.dart.textual_outline_modelled.expect | 2 +- .../member_inheritance_from_opt_in.dart | 4 +- ...ce_from_opt_in.dart.textual_outline.expect | 4 +- ...pt_in.dart.textual_outline_modelled.expect | 4 +- .../member_inheritance_from_opt_in_lib.dart | 6 +- .../member_inheritance_from_opt_out.dart | 8 +- ...e_from_opt_out.dart.textual_outline.expect | 8 +- ...t_out.dart.textual_outline_modelled.expect | 8 +- pkg/front_end/tool/_fasta/entry_points.dart | 12 +- pkg/front_end/tool/ast_model.dart | 2 +- pkg/front_end/tool/dart_doctest_impl.dart | 6 +- pkg/front_end/tool/fasta_perf.dart | 2 +- .../tool/generate_ast_equivalence.dart | 12 +- .../tool/parser_direct_ast/viewer.dart | 2 +- pkg/front_end/tool/perf_common.dart | 2 +- pkg/front_end/tool/smoke_test_quick.dart | 2 +- pkg/front_end/tool/stat_on_dash_v.dart | 2 +- pkg/front_end/tool/visitor_generator.dart | 2 +- pkg/frontend_server/lib/compute_kernel.dart | 2 +- pkg/frontend_server/lib/frontend_server.dart | 10 +- .../test/frontend_server_flutter.dart | 2 +- .../test/frontend_server_test.dart | 10 +- pkg/kernel/lib/ast.dart | 171 +++++----- pkg/kernel/lib/binary/ast_from_binary.dart | 12 +- pkg/kernel/lib/binary/ast_to_binary.dart | 8 +- pkg/kernel/lib/class_hierarchy.dart | 34 +- pkg/kernel/lib/kernel.dart | 2 +- pkg/kernel/lib/naive_type_checker.dart | 2 +- pkg/kernel/lib/src/equivalence.dart | 6 +- pkg/kernel/lib/src/equivalence_helpers.dart | 8 +- .../src/hierarchy_based_type_environment.dart | 2 +- pkg/kernel/lib/src/node_creator.dart | 16 +- pkg/kernel/lib/src/printer.dart | 28 +- pkg/kernel/lib/src/text_util.dart | 23 +- .../lib/src/tool/command_line_util.dart | 2 +- pkg/kernel/lib/src/union_find.dart | 2 +- pkg/kernel/lib/target/targets.dart | 46 +-- pkg/kernel/lib/testing/type_parser.dart | 2 +- pkg/kernel/lib/text/ast_to_text.dart | 15 +- .../track_widget_constructor_locations.dart | 4 +- pkg/kernel/lib/type_algebra.dart | 4 +- pkg/kernel/lib/type_checker.dart | 4 +- pkg/kernel/lib/type_environment.dart | 8 +- pkg/kernel/lib/verifier.dart | 4 +- pkg/kernel/test/binary_bench.dart | 4 +- pkg/kernel/test/class_hierarchy_basic.dart | 10 +- pkg/kernel/test/class_hierarchy_test.dart | 6 +- pkg/kernel/test/type_hashcode_test.dart | 4 +- pkg/kernel/tool/smoke_test_quick.dart | 2 +- pkg/vm/bin/kernel_service.dart | 46 +-- pkg/vm/lib/incremental_compiler.dart | 2 +- pkg/vm/lib/kernel_front_end.dart | 30 +- pkg/vm/lib/metadata/inferred_type.dart | 4 +- pkg/vm/lib/metadata/procedure_attributes.dart | 14 +- pkg/vm/lib/target/vm.dart | 40 +-- pkg/vm/lib/transformations/ffi/common.dart | 8 +- pkg/vm/lib/transformations/ffi/use_sites.dart | 2 +- .../transformations/type_flow/analysis.dart | 5 +- .../transformations/type_flow/summary.dart | 6 +- .../type_flow/summary_collector.dart | 6 +- .../type_flow/transformer.dart | 14 +- pkg/vm/test/common_test_utils.dart | 3 +- pkg/vm/test/incremental_compiler_test.dart | 4 +- .../transformer/const_default.lib.dart | 4 +- 412 files changed, 1953 insertions(+), 1934 deletions(-) diff --git a/pkg/_fe_analyzer_shared/lib/src/base/errors.dart b/pkg/_fe_analyzer_shared/lib/src/base/errors.dart index bcaa62b1517..683754d00bc 100644 --- a/pkg/_fe_analyzer_shared/lib/src/base/errors.dart +++ b/pkg/_fe_analyzer_shared/lib/src/base/errors.dart @@ -48,7 +48,7 @@ abstract class ErrorCode { const ErrorCode({ String? correctionMessage, this.hasPublishedDocs = false, - this.isUnresolvedIdentifier: false, + this.isUnresolvedIdentifier = false, required this.name, required String problemMessage, required this.uniqueName, diff --git a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart index 118c57159f1..830a3798d38 100644 --- a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart +++ b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart @@ -1320,7 +1320,7 @@ class FlowAnalysisDebug(String description, T callback(), - {bool isQuery: false, bool? isPure}) { + {bool isQuery = false, bool? isPure}) { isPure ??= isQuery; print(description); T result; diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes.dart index 202dad861e2..9c283e103e0 100644 --- a/pkg/_fe_analyzer_shared/lib/src/messages/codes.dart +++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes.dart @@ -31,7 +31,7 @@ class Code { final Severity severity; const Code(this.name, - {this.index: -1, this.analyzerCodes, this.severity: Severity.error}); + {this.index = -1, this.analyzerCodes, this.severity = Severity.error}); String toString() => name; } diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/identifier_context.dart b/pkg/_fe_analyzer_shared/lib/src/parser/identifier_context.dart index d539c6c17b4..00689b69b70 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/identifier_context.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/identifier_context.dart @@ -305,14 +305,14 @@ abstract class IdentifierContext { final Template<_MessageWithArgument> recoveryTemplate; const IdentifierContext(this._name, - {this.inDeclaration: false, - this.inLibraryOrPartOfDeclaration: false, - this.inSymbol: false, - this.isContinuation: false, - this.isScopeReference: false, - this.isBuiltInIdentifierAllowed: true, + {this.inDeclaration = false, + this.inLibraryOrPartOfDeclaration = false, + this.inSymbol = false, + this.isContinuation = false, + this.isScopeReference = false, + this.isBuiltInIdentifierAllowed = true, bool? allowedInConstantExpression, - this.recoveryTemplate: templateExpectedIdentifier}) + this.recoveryTemplate = templateExpectedIdentifier}) : this.allowedInConstantExpression = // Generally, declarations are legal in constant expressions. A // continuation doesn't affect constant expressions: if what it's diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser.dart index ade0f51373e..bd6c0907b4e 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/parser.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser.dart @@ -58,7 +58,7 @@ class ErrorCollectingListener extends Listener { } List parse(Token tokens, - {bool useImplicitCreationExpression: true}) { + {bool useImplicitCreationExpression = true}) { ErrorCollectingListener listener = new ErrorCollectingListener(); Parser parser = new Parser(listener, useImplicitCreationExpression: useImplicitCreationExpression); diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart index 5465c811d12..93449e3a92e 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart @@ -317,7 +317,7 @@ class Parser { // implicit create expression without the special casing. final bool useImplicitCreationExpression; - Parser(this.listener, {this.useImplicitCreationExpression: true}) + Parser(this.listener, {this.useImplicitCreationExpression = true}) : assert(listener != null); // ignore:unnecessary_null_comparison bool get inGenerator { diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart b/pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart index f9c5bfc0191..36da5a16269 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart @@ -523,7 +523,7 @@ abstract class StackListener extends Listener { } void addProblem(Message message, int charOffset, int length, - {bool wasHandled: false, List context}); + {bool wasHandled = false, List context}); } abstract class Stack { diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/io.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/io.dart index 066fe881cd5..5a9a9637d26 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/io.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/io.dart @@ -23,7 +23,7 @@ List readBytesFromFileSync(Uri uri) { } Future> readBytesFromFile(Uri uri, - {bool ensureZeroTermination: true}) async { + {bool ensureZeroTermination = true}) async { RandomAccessFile file = await new File.fromUri(uri).open(); Uint8List list; try { diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/scanner.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/scanner.dart index b9b7cbcfb10..62c5159d517 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/scanner.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/scanner.dart @@ -68,7 +68,7 @@ class ScannerResult { /// Scan/tokenize the given UTF8 [bytes]. ScannerResult scan(List bytes, {ScannerConfiguration? configuration, - bool includeComments: false, + bool includeComments = false, LanguageVersionChanged? languageVersionChanged}) { if (bytes.last != 0) { throw new ArgumentError("[bytes]: the last byte must be 0."); @@ -83,7 +83,7 @@ ScannerResult scan(List bytes, /// Scan/tokenize the given [source]. ScannerResult scanString(String source, {ScannerConfiguration? configuration, - bool includeComments: false, + bool includeComments = false, LanguageVersionChanged? languageVersionChanged}) { // ignore: unnecessary_null_comparison assert(source != null, 'source must not be null'); diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/scanner_main.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/scanner_main.dart index 18c7c7e6f74..2d844f7e0bd 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/scanner_main.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/scanner_main.dart @@ -8,7 +8,8 @@ import 'io.dart' show readBytesFromFileSync; import 'scanner.dart' show ErrorToken, Token, scan; -scanAll(Map> files, {bool verbose: false, bool verify: false}) { +scanAll(Map> files, + {bool verbose = false, bool verify = false}) { Stopwatch sw = new Stopwatch()..start(); int byteCount = 0; files.forEach((Uri uri, List bytes) { diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/string_scanner.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/string_scanner.dart index 96f953f1d47..c485d1bc3aa 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/string_scanner.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/string_scanner.dart @@ -39,7 +39,7 @@ class StringScanner extends AbstractScanner { StringScanner(String string, {ScannerConfiguration? configuration, - bool includeComments: false, + bool includeComments = false, LanguageVersionChanged? languageVersionChanged}) : string = ensureZeroTermination(string), super(configuration, includeComments, languageVersionChanged); diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/token.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/token.dart index 0bbb2546695..bc3fe895337 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/token.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/token.dart @@ -415,9 +415,9 @@ class Keyword extends TokenType { * Initialize a newly created keyword. */ const Keyword(int index, String lexeme, String name, this.keywordStyle, - {bool isModifier: false, - bool isTopLevelKeyword: false, - int precedence: NO_PRECEDENCE}) + {bool isModifier = false, + bool isTopLevelKeyword = false, + int precedence = NO_PRECEDENCE}) : super(index, lexeme, name, precedence, KEYWORD_TOKEN, isModifier: isModifier, isTopLevelKeyword: isTopLevelKeyword); @@ -1684,12 +1684,12 @@ class TokenType { const TokenType( this.index, this.lexeme, this.name, this.precedence, this.kind, {this.binaryOperatorOfCompoundAssignment, - this.isBinaryOperator: false, - this.isModifier: false, - this.isOperator: false, - this.isTopLevelKeyword: false, - this.isUserDefinableOperator: false, - String? stringValue: 'unspecified'}) + this.isBinaryOperator = false, + this.isModifier = false, + this.isOperator = false, + this.isTopLevelKeyword = false, + this.isUserDefinableOperator = false, + String? stringValue = 'unspecified'}) : this.stringValue = stringValue == 'unspecified' ? lexeme : stringValue; /** diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart index 4c869ba3c2a..8f9b505719a 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart @@ -40,7 +40,7 @@ class StringTokenImpl extends SimpleToken implements StringToken { * is canonicalized before the token is created. */ StringTokenImpl.fromString(TokenType type, String value, int charOffset, - {bool canonicalize: false, CommentToken? precedingComments}) + {bool canonicalize = false, CommentToken? precedingComments}) : valueOrLazySubstring = canonicalize ? canonicalizedString(value) : value, super(type, charOffset, precedingComments); @@ -51,7 +51,7 @@ class StringTokenImpl extends SimpleToken implements StringToken { */ StringTokenImpl.fromSubstring( TokenType type, String data, int start, int end, int charOffset, - {bool canonicalize: false, CommentToken? precedingComments}) + {bool canonicalize = false, CommentToken? precedingComments}) : super(type, charOffset, precedingComments) { int length = end - start; if (length <= LAZY_THRESHOLD) { @@ -166,7 +166,7 @@ class LanguageVersionTokenImpl extends CommentTokenImpl LanguageVersionTokenImpl.fromSubstring( String string, int start, int end, int tokenStart, this.major, this.minor, - {bool canonicalize: false}) + {bool canonicalize = false}) : super.fromSubstring( TokenType.SINGLE_LINE_COMMENT, string, start, end, tokenStart, canonicalize: canonicalize); diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart index a0fd026bfa6..c734c8861be 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart @@ -89,7 +89,7 @@ class Utf8BytesScanner extends AbstractScanner { */ Utf8BytesScanner(this.bytes, {ScannerConfiguration? configuration, - bool includeComments: false, + bool includeComments = false, LanguageVersionChanged? languageVersionChanged}) : super(configuration, includeComments, languageVersionChanged, numberOfBytesHint: bytes.length) { diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/features.dart b/pkg/_fe_analyzer_shared/lib/src/testing/features.dart index 113d1d86958..34f508b89c0 100644 --- a/pkg/_fe_analyzer_shared/lib/src/testing/features.dart +++ b/pkg/_fe_analyzer_shared/lib/src/testing/features.dart @@ -30,7 +30,7 @@ class Features { /// Mark the feature [key] as existing. If [value] is provided, the feature /// [key] is set to have this value. - void add(String key, {var value: ''}) { + void add(String key, {var value = ''}) { _features[key] = value.toString(); } diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/id.dart b/pkg/_fe_analyzer_shared/lib/src/testing/id.dart index e1596e1f0ae..8d9db1afc7e 100644 --- a/pkg/_fe_analyzer_shared/lib/src/testing/id.dart +++ b/pkg/_fe_analyzer_shared/lib/src/testing/id.dart @@ -125,8 +125,8 @@ class IdValue { static const String errorPrefix = "error: "; static IdValue decode(Uri sourceUri, Annotation annotation, String text, - {bool preserveWhitespaceInAnnotations: false, - bool preserveInfixWhitespace: false}) { + {bool preserveWhitespaceInAnnotations = false, + bool preserveInfixWhitespace = false}) { int offset = annotation.offset; Id id; String expected; @@ -203,7 +203,7 @@ class MemberId implements Id { @override final bool isGlobal; - factory MemberId(String text, {bool isGlobal: false}) { + factory MemberId(String text, {bool isGlobal = false}) { int dotPos = text.indexOf('.'); if (dotPos != -1) { return new MemberId.internal(text.substring(dotPos + 1), @@ -213,7 +213,7 @@ class MemberId implements Id { } } - MemberId.internal(this.memberName, {this.className, this.isGlobal: false}); + MemberId.internal(this.memberName, {this.className, this.isGlobal = false}); @override int get hashCode => className.hashCode * 13 + memberName.hashCode * 17; @@ -243,7 +243,7 @@ class ClassId implements Id { @override final bool isGlobal; - ClassId(this.className, {this.isGlobal: false}); + ClassId(this.className, {this.isGlobal = false}); @override int get hashCode => className.hashCode * 13; diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/id_generation.dart b/pkg/_fe_analyzer_shared/lib/src/testing/id_generation.dart index a1bbadbcd5b..1be8ff91321 100644 --- a/pkg/_fe_analyzer_shared/lib/src/testing/id_generation.dart +++ b/pkg/_fe_analyzer_shared/lib/src/testing/id_generation.dart @@ -13,7 +13,7 @@ Map> computeAnnotationsPerUri( Map>>> actualData, DataInterpreter dataInterpreter, {Annotation? Function(Annotation? expected, Annotation? actual)? createDiff, - bool forceUpdate: false}) { + bool forceUpdate = false}) { Set uriSet = {}; Set actualMarkers = actualData.keys.toSet(); Map>> idValuePerUri = {}; @@ -69,8 +69,8 @@ Map> computeAnnotationsPerUri( if (code != null) { // Annotations are not computed from synthesized code. result[uri] = _computeAnnotations(code, expectedMaps.keys, actualMarkers, - idValuePerId, actualDataPerId, dataInterpreter, - sortMarkers: false, createDiff: createDiff, forceUpdate: forceUpdate); + idValuePerId, actualDataPerId, dataInterpreter, + sortMarkers: false, createDiff: createDiff, forceUpdate: forceUpdate); } } return result; @@ -83,11 +83,11 @@ List _computeAnnotations( Map> idValuePerId, Map>> actualDataPerId, DataInterpreter dataInterpreter, - {String defaultPrefix: '/*', - String defaultSuffix: '*/', - bool sortMarkers: true, + {String defaultPrefix = '/*', + String defaultSuffix = '*/', + bool sortMarkers = true, Annotation? Function(Annotation? expected, Annotation? actual)? createDiff, - bool forceUpdate: false}) { + bool forceUpdate = false}) { // ignore: unnecessary_null_comparison assert(annotatedCode != null); @@ -156,7 +156,9 @@ List _computeAnnotations( suffix); } - Set idSet = {}..addAll(idValuePerId.keys)..addAll(actualDataPerId.keys); + Set idSet = {} + ..addAll(idValuePerId.keys) + ..addAll(actualDataPerId.keys); List result = []; for (Id id in idSet) { Map idValuePerMarker = idValuePerId[id] ?? {}; diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart b/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart index 04fe99d02e5..e34d83059fb 100644 --- a/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart +++ b/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart @@ -218,8 +218,8 @@ class MemberAnnotations { void computeExpectedMap(Uri sourceUri, String filename, AnnotatedCode code, Map> maps, {required void onFailure(String message), - bool preserveWhitespaceInAnnotations: false, - bool preserveInfixWhitespaceInAnnotations: false}) { + bool preserveWhitespaceInAnnotations = false, + bool preserveInfixWhitespaceInAnnotations = false}) { List mapKeys = maps.keys.toList(); Map split = splitByPrefixes(code, mapKeys); @@ -263,8 +263,8 @@ TestData computeTestData(FileSystemEntity testFile, {required Iterable supportedMarkers, required Uri createTestUri(Uri uri, String fileName), required void onFailure(String message), - bool preserveWhitespaceInAnnotations: false, - bool preserveInfixWhitespaceInAnnotations: false}) { + bool preserveWhitespaceInAnnotations = false, + bool preserveInfixWhitespaceInAnnotations = false}) { Uri? entryPoint; String testName; @@ -406,7 +406,7 @@ abstract class CompiledData { Map> computeDiffAnnotationsAgainst( Map> thisMap, Map> otherMap, Uri uri, - {bool includeMatches: false}) { + {bool includeMatches = false}) { Map> annotations = >{}; thisMap.forEach((Id id, ActualData thisData) { ActualData? otherData = otherMap[id]; @@ -436,7 +436,8 @@ abstract class CompiledData { int getOffsetFromId(Id id, Uri uri); - void reportError(Uri uri, int offset, String message, {bool succinct: false}); + void reportError(Uri uri, int offset, String message, + {bool succinct = false}); } /// Interface used for interpreting annotations. @@ -513,8 +514,8 @@ Future> checkCode( CompiledData compiledData, DataInterpreter dataInterpreter, {bool filterActualData(IdValue? expected, ActualData actualData)?, - bool fatalErrors: true, - bool succinct: false, + bool fatalErrors = true, + bool succinct = false, required void onFailure(String message)}) async { String testName = testData.name; Map code = testData.code; @@ -703,7 +704,7 @@ class MarkerOptions { MarkerOptions.internal(this.markers); factory MarkerOptions.fromDataDir(Directory dataDir, - {bool shouldFindScript: true}) { + {bool shouldFindScript = true}) { File file = new File.fromUri(dataDir.uri.resolve('marker.options')); File script = new File.fromUri(Platform.script); if (!file.existsSync()) { @@ -810,17 +811,17 @@ const List