Make `param_kind` non-optional
commit6b8fa4516f06fbbdcfdeb96255c79d6092dc37af
authorHunter Goldstein <hgoldstein@fb.com>
Fri, 24 Sep 2021 19:52:20 +0000 (24 12:52 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 24 Sep 2021 19:54:20 +0000 (24 12:54 -0700)
treebe6c632ebf840dce618648c89a4c4339e7df6c8c
parent0417643aa2b73f7838c7102df68a8a8942b162ef
Make `param_kind` non-optional

Summary:
Now that references are dead, `Callconv` should only appear in a function call position, e.g. the expression in square brackets below:
```
foobar(
  [inout $foo],
  $bar,
  $baz,
);
```

Instead of having a `Callconv` node, let's indicate that function calls have a calling convention associated with each parameter.

The first step in doing this is to add `Pnormal` to the `param_kind` type: instead of representing calling convention with an optional param_kind, we explicitly note whether it's `Pnormal` or `Pinout`. We seem to use "normal" to describe this elsewhere (e.g. in `hhbc`).

Reviewed By: Wilfred

Differential Revision: D30495831

fbshipit-source-id: 6c85f636b1582ae7b27b663a360e01bd1d58e228
212 files changed:
hphp/hack/src/annotated_ast/aast.ml
hphp/hack/src/annotated_ast/aast_defs.ml
hphp/hack/src/ast/ast_defs.ml
hphp/hack/src/hhbc/bytecode_printer/print.rs
hphp/hack/src/hhbc/hhbc_by_ref/closure_convert.rs
hphp/hack/src/hhbc/hhbc_by_ref/emit_param.rs
hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs
hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs
hphp/hack/src/oxidized/gen/aast.rs
hphp/hack/src/oxidized/gen/aast_defs.rs
hphp/hack/src/oxidized/gen/ast_defs.rs
hphp/hack/src/oxidized/impl_gen/ast_defs_impl_gen.rs
hphp/hack/src/oxidized_by_ref/gen/aast.rs
hphp/hack/src/oxidized_by_ref/gen/aast_defs.rs
hphp/hack/src/oxidized_by_ref/manual/typing_defs_core_impl.rs
hphp/hack/src/parser/lowerer/desugar_expression_tree.rs
hphp/hack/src/parser/lowerer/lowerer.rs
hphp/hack/src/server/fileOutline.ml
hphp/hack/src/server/serverExtractStandalone.ml
hphp/hack/src/typing/nast_check/inout_check.ml
hphp/hack/src/typing/tast_check/bad_type_logger/bad_type_logger.ml
hphp/hack/src/typing/tast_typecheck.ml
hphp/hack/src/typing/typing_defs.ml
hphp/hack/src/typing/typing_defs.mli
hphp/hack/src/typing/typing_variance.ml
hphp/hack/src/typing/write_symbol_info/symbol_build_json.ml
hphp/hack/test/holes/append_keyset.php.holes.exp
hphp/hack/test/holes/append_set.php.holes.exp
hphp/hack/test/holes/append_string_datetime.php.holes.exp
hphp/hack/test/holes/array_access_read_object.php.holes.exp
hphp/hack/test/holes/array_access_read_prim.php.holes.exp
hphp/hack/test/holes/array_access_write_intersection.php.holes.exp
hphp/hack/test/holes/array_access_write_object.php.holes.exp
hphp/hack/test/holes/array_access_write_prim.php.holes.exp
hphp/hack/test/holes/array_access_write_union.php.holes.exp
hphp/hack/test/holes/array_append_object.php.holes.exp
hphp/hack/test/holes/array_append_prim.php.holes.exp
hphp/hack/test/holes/array_append_union.php.holes.exp
hphp/hack/test/holes/array_const_mutation_immvector.php.holes.exp
hphp/hack/test/holes/array_const_mutation_keyedcontainer.php.holes.exp
hphp/hack/test/holes/array_get_index_dict.php.holes.exp
hphp/hack/test/holes/array_get_index_immvector.php.holes.exp
hphp/hack/test/holes/array_get_index_keyed_container.php.holes.exp
hphp/hack/test/holes/array_get_index_keyset.php.holes.exp
hphp/hack/test/holes/array_get_index_map.php.holes.exp
hphp/hack/test/holes/array_get_index_mixed.php.holes.exp
hphp/hack/test/holes/array_get_index_nullable.php.holes.exp
hphp/hack/test/holes/array_get_index_pair.php.holes.exp
hphp/hack/test/holes/array_get_index_string.php.holes.exp
hphp/hack/test/holes/array_get_index_tuple.php.holes.exp
hphp/hack/test/holes/array_get_index_varray.php.holes.exp
hphp/hack/test/holes/array_get_index_vec.php.holes.exp
hphp/hack/test/holes/array_get_index_vector.php.holes.exp
hphp/hack/test/holes/assign_array_append_intersection.php.holes.exp
hphp/hack/test/holes/assign_array_append_set.php.holes.exp
hphp/hack/test/holes/assign_array_append_union.php.holes.exp
hphp/hack/test/holes/assign_array_append_vector.php.holes.exp
hphp/hack/test/holes/assign_array_get_index_dict.php.holes.exp
hphp/hack/test/holes/assign_array_get_index_map.php.holes.exp
hphp/hack/test/holes/assign_array_get_index_string.php.holes.exp
hphp/hack/test/holes/assign_array_get_index_tuple.php.holes.exp
hphp/hack/test/holes/assign_array_get_index_varray.php.holes.exp
hphp/hack/test/holes/assign_array_get_index_vec.php.holes.exp
hphp/hack/test/holes/assign_array_get_index_vector.php.holes.exp
hphp/hack/test/holes/assign_array_get_map.php.holes.exp
hphp/hack/test/holes/assign_array_get_string.php.holes.exp
hphp/hack/test/holes/assign_array_get_union.php.holes.exp
hphp/hack/test/holes/assign_array_get_vector.php.holes.exp
hphp/hack/test/holes/assign_class_get.php.holes.exp
hphp/hack/test/holes/assign_list.php.holes.exp
hphp/hack/test/holes/assign_obj_get.php.holes.exp
hphp/hack/test/holes/call_collection.php.holes.exp
hphp/hack/test/holes/call_dead_code.php.holes.exp
hphp/hack/test/holes/call_dict.php.holes.exp
hphp/hack/test/holes/call_generic.php.holes.exp
hphp/hack/test/holes/call_imm_set.php.holes.exp
hphp/hack/test/holes/call_imm_vector.php.holes.exp
hphp/hack/test/holes/call_inout.php.holes.exp
hphp/hack/test/holes/call_iterable.php.holes.exp
hphp/hack/test/holes/call_keyed_traversable.php.holes.exp
hphp/hack/test/holes/call_keyset.php.holes.exp
hphp/hack/test/holes/call_pair.php.holes.exp
hphp/hack/test/holes/call_prim.php.holes.exp
hphp/hack/test/holes/call_refinement.php.holes.exp
hphp/hack/test/holes/call_set.php.holes.exp
hphp/hack/test/holes/call_traversable.php.holes.exp
hphp/hack/test/holes/call_tuple.php.holes.exp
hphp/hack/test/holes/call_unpack.php.holes.exp
hphp/hack/test/holes/call_variadic.php.holes.exp
hphp/hack/test/holes/call_varray.php.holes.exp
hphp/hack/test/holes/call_varray_or_darray.php.holes.exp
hphp/hack/test/holes/call_vec.php.holes.exp
hphp/hack/test/holes/call_vector.php.holes.exp
hphp/hack/test/holes/compound_assign_bitwise_and.php.holes.exp
hphp/hack/test/holes/compound_assign_div.php.holes.exp
hphp/hack/test/holes/compound_assign_plus.php.holes.exp
hphp/hack/test/holes/compound_assign_rshift.php.holes.exp
hphp/hack/test/holes/echo_non_arraykey.php.holes.exp
hphp/hack/test/holes/expected_class.php.holes.exp
hphp/hack/test/holes/expected_class_intersection.php.holes.exp
hphp/hack/test/holes/expected_class_intersection_classname.php.holes.exp
hphp/hack/test/holes/expected_class_union.php.holes.exp
hphp/hack/test/holes/expected_class_union_classname.php.holes.exp
hphp/hack/test/holes/expr_dependent.php.holes.exp
hphp/hack/test/holes/foreach_async_non_traversable.php.holes.exp
hphp/hack/test/holes/foreach_async_union_int_dynamic.php.holes.exp
hphp/hack/test/holes/foreach_kv_non_traversable.php.holes.exp
hphp/hack/test/holes/foreach_kv_union_int_dynamic.php.holes.exp
hphp/hack/test/holes/foreach_non_traversable.php.holes.exp
hphp/hack/test/holes/foreach_union_int_dynamic.php.holes.exp
hphp/hack/test/holes/keyset_lit.php.holes.exp
hphp/hack/test/holes/member_not_found_method.php.holes.exp
hphp/hack/test/holes/member_not_found_property.php.holes.exp
hphp/hack/test/holes/non_object_member_read_intersection.php.holes.exp
hphp/hack/test/holes/non_object_member_read_method.php.holes.exp
hphp/hack/test/holes/non_object_member_read_property.php.holes.exp
hphp/hack/test/holes/non_object_member_read_union.php.holes.exp
hphp/hack/test/holes/null_member_read_method.php.holes.exp
hphp/hack/test/holes/null_member_read_property.php.holes.exp
hphp/hack/test/holes/return_awaitable_void.php.holes.exp
hphp/hack/test/holes/string_interp.php.holes.exp
hphp/hack/test/holes/unsafe_cast_flow_typing.php.holes.exp
hphp/hack/test/holes/xhp_simple_attribute.php.holes.exp
hphp/hack/test/holes/xhp_spread_attribute.php.holes.exp
hphp/hack/test/nast/coeffects/poly_ctx.php.exp
hphp/hack/test/nast/coeffects/poly_var.php.exp
hphp/hack/test/nast/coeffects_poly_var.php.exp
hphp/hack/test/nast/expression_tree.php.exp
hphp/hack/test/nast/expression_tree_assign.php.exp
hphp/hack/test/nast/expression_tree_for.php.exp
hphp/hack/test/nast/expression_tree_function_order.php.exp
hphp/hack/test/nast/expression_tree_loop.php.exp
hphp/hack/test/nast/expression_tree_splice.php.exp
hphp/hack/test/nast/expression_tree_xhp.php.exp
hphp/hack/test/nast/file_attributes_in_namespaces_with_namespaced_values.php.exp
hphp/hack/test/nast/fun_decl.php.exp
hphp/hack/test/nast/fun_empty.php.exp
hphp/hack/test/nast/hh_show.php.exp
hphp/hack/test/nast/top_level.php.exp
hphp/hack/test/tast/add_vector.php.exp
hphp/hack/test/tast/arith_plus.php.exp
hphp/hack/test/tast/array_filter.php.exp
hphp/hack/test/tast/array_map.php.exp
hphp/hack/test/tast/async_lambda.php.exp
hphp/hack/test/tast/call_args.php.exp
hphp/hack/test/tast/coeffects.php.exp
hphp/hack/test/tast/construct_unknown_class.php.exp
hphp/hack/test/tast/contravariant_solve.php.exp
hphp/hack/test/tast/control_flow/do.php.exp
hphp/hack/test/tast/control_flow/do_throw_while.php.exp
hphp/hack/test/tast/control_flow/dos.php.exp
hphp/hack/test/tast/control_flow/while.php.exp
hphp/hack/test/tast/control_flow/while_throw.php.exp
hphp/hack/test/tast/dict_attribute.php.exp
hphp/hack/test/tast/dynamic_member_access.php.exp
hphp/hack/test/tast/eq_op.php.exp
hphp/hack/test/tast/file_attributes_in_namespaces_with_namespaced_values.php.exp
hphp/hack/test/tast/fun_meth_variadic.php.exp
hphp/hack/test/tast/global_inference/array.php.exp
hphp/hack/test/tast/global_inference/call_chain.php.exp
hphp/hack/test/tast/global_inference/call_chain_evil.php.exp
hphp/hack/test/tast/global_inference/call_chain_evil2.php.exp
hphp/hack/test/tast/global_inference/call_chain_evil_evil.php.exp
hphp/hack/test/tast/global_inference/call_chain_evil_evil1.php.exp
hphp/hack/test/tast/global_inference/call_chain_evil_evil1_static.php.exp
hphp/hack/test/tast/global_inference/fun_composed.php.exp
hphp/hack/test/tast/global_inference/fun_composed_small.php.exp
hphp/hack/test/tast/global_inference/id_composed.php.exp
hphp/hack/test/tast/global_inference/map.php.exp
hphp/hack/test/tast/global_inference/mymap.php.exp
hphp/hack/test/tast/global_inference/params/type_hint_inferred_parameters.php.exp
hphp/hack/test/tast/global_inference/params/type_hint_inferred_parameters_constructor.php.exp
hphp/hack/test/tast/global_inference/params/type_hint_parameter_call.php.exp
hphp/hack/test/tast/global_inference/params/type_hint_parameter_call_method.php.exp
hphp/hack/test/tast/global_inference/params/type_hint_parameter_indirect.php.exp
hphp/hack/test/tast/global_inference/params/type_hint_parameter_method.php.exp
hphp/hack/test/tast/global_inference/params/type_hint_parameter_survive_assignment.php.exp
hphp/hack/test/tast/global_inference/partial_annot.php.exp
hphp/hack/test/tast/global_inference/partial_annot_where.php.exp
hphp/hack/test/tast/global_inference/properties/type_hint_inferred_property_assignment.php.exp
hphp/hack/test/tast/global_inference/properties/type_hint_inferred_property_constructor.php.exp
hphp/hack/test/tast/global_inference/properties/type_hint_inferred_property_getter.php.exp
hphp/hack/test/tast/global_inference/properties/type_hint_inferred_property_setter.php.exp
hphp/hack/test/tast/global_inference/reinfer_types/call_chain_evil.php.exp
hphp/hack/test/tast/global_inference/reinfer_types/return_type_awaitable.php.exp
hphp/hack/test/tast/global_inference/return/type_hint_inferred_function.php.exp
hphp/hack/test/tast/global_inference/return/type_hint_inferred_method.php.exp
hphp/hack/test/tast/global_inference/type_hint_inferred_anon_function.php.exp
hphp/hack/test/tast/global_inference/typeparams/type_hint_typeparameter_custom.php.exp
hphp/hack/test/tast/global_inference/typeparams/type_hint_typeparameter_method.php.exp
hphp/hack/test/tast/global_inference/typeparams/type_hint_typeparameter_subtyping.php.exp
hphp/hack/test/tast/global_inference/typeparams/type_hint_typeparameter_variance.php.exp
hphp/hack/test/tast/lambda1.php.exp
hphp/hack/test/tast/lambda_contextual.php.exp
hphp/hack/test/tast/lambda_efun.php.exp
hphp/hack/test/tast/lambda_return_type.php.exp
hphp/hack/test/tast/mixed_mixed.php.exp
hphp/hack/test/tast/multiple_type.php.exp
hphp/hack/test/tast/null_check.php.exp
hphp/hack/test/tast/null_coalesce.php.exp
hphp/hack/test/tast/null_coalesce_assignment.php.exp
hphp/hack/test/tast/parent_construct.php.exp
hphp/hack/test/tast/parent_method.php.exp
hphp/hack/test/tast/pseudofunctions.php.exp
hphp/hack/test/tast/re_prefixed_string/re_prefixed_string.php.exp
hphp/hack/test/tast/reactive.php.exp
hphp/hack/test/tast/reified_generic_shadowing2.php.exp
hphp/hack/test/tast/reify_mix_with_erased.php.exp
hphp/hack/test/tast/shapes_special_functions.php.exp
hphp/hack/test/tast/singleton_unresolved_function_call.php.exp
hphp/hack/test/tast/typedef.php.exp
hphp/hack/test/tast/unresolved_grown_after_lambda.php.exp