Add optional and variadic fields for TypeStructure representation of tuplesmaster
commit84b51c4165ce3dab0f1496cdcb5237a7ba835418
authorAndrew Kennedy <akenn@meta.com>
Thu, 30 Jan 2025 15:53:06 +0000 (30 07:53 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 30 Jan 2025 15:53:06 +0000 (30 07:53 -0800)
tree1f5bd21c55139ceeb786ddf31e50ed628f7f0eca
parent7c9962084e967713a0016d65d761e8fa6708d7fc
Add optional and variadic fields for TypeStructure representation of tuples

Summary: As the title says, to match what we now implement in HHVM, we update `TypeStructure` to represent optional and variadic elements of tuple types. Unlike other fields, we *correctly* make these optional fields rather than fields with nullable type.

Reviewed By: francesco-zappa-nardelli

Differential Revision: D68327596

fbshipit-source-id: fa92bfcaa2e1f761833945cdb4397256b76b3a8e
21 files changed:
hphp/hack/hhi/typestructure.hhi
hphp/hack/src/typing/typing_structure.ml
hphp/hack/test/typecheck/bad_type_structure_array.php.exp
hphp/hack/test/typecheck/bad_type_structure_class.php.exp
hphp/hack/test/typecheck/bad_type_structure_function.php.exp
hphp/hack/test/typecheck/bad_type_structure_function.php.imp_pess_exp
hphp/hack/test/typecheck/bad_type_structure_nullable.php.exp
hphp/hack/test/typecheck/bad_type_structure_primitive.php.exp
hphp/hack/test/typecheck/bad_type_structure_shape.php.exp
hphp/hack/test/typecheck/bad_type_structure_tuple.php.exp
hphp/hack/test/typecheck/case_type/case_type_overlapping_variants_arrays.php.exp
hphp/hack/test/typecheck/case_type/case_type_overlapping_variants_arrays.php.imp_pess_exp
hphp/hack/test/typecheck/type_structure/HH_FLAGS
hphp/hack/test/typecheck/type_structure/type_structure1.php.imp_pess_exp
hphp/hack/test/typecheck/type_structure/type_structure2.php.exp
hphp/hack/test/typecheck/type_structure/type_structure3.php.exp
hphp/hack/test/typecheck/type_structure/type_structure_generic.php.exp
hphp/hack/test/typecheck/type_structure/type_structure_tuple.php [new file with mode: 0644]
hphp/hack/test/typecheck/type_structure/type_structure_tuple.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/type_structure/type_structure_typeconst.php.exp
hphp/hack/test/typecheck/type_structure_hack_array.php.exp