Avoid adding two holes to value collection literals
commitc2d849cba50809aa11bffbed8391e185907a7dba
authorMichael Thomas <mjt@fb.com>
Fri, 1 Apr 2022 09:59:39 +0000 (1 02:59 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 1 Apr 2022 09:59:39 +0000 (1 02:59 -0700)
tree7d438db6385a28c3998f34d4c9bb19c5fb2e0768
parent18aa0eda866aa53a98b0c573f5e59d03833371da
Avoid adding two holes to value collection literals

Summary: ValueCollection literals are special cased in typing since we know that all elements must be subtypes of arraykey. However, since a `Hole` doesn't change the type of an expression, typing will later identify another type mismatch and add a second `Hole`. This diff adds a flag to the helper function `compute_exprs_and_supertype` to avoid doing this

Reviewed By: andrewjkennedy

Differential Revision: D35245209

fbshipit-source-id: df5cdeb58175016766a49e507433530412323a10
hphp/hack/src/typing/typing.ml
hphp/hack/test/holes/keyset_lit.php.holes.exp
hphp/hack/test/holes/value_collection_lit.php.holes.exp