Better inference & `Hole` on nullable object get
commit78c4aa6cf9bd1d57b056d8640a11e2d1f41feea0
authorMichael Thomas <mjt@fb.com>
Wed, 13 Jul 2022 12:19:45 +0000 (13 05:19 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 13 Jul 2022 12:19:45 +0000 (13 05:19 -0700)
tree32305729cf6283a58cbd9f21b5d1bdebbf24b3a5
parenteaea568f050e230166c4deab68470c85f085e130
Better inference & `Hole` on nullable object get

Summary: Adds special casing of nullable object get when the receiver type is optional. In the case that object get succeeds on the inner non-null type, we  use the resulting member type and give the non-null type as the suggested type for use in a `Hole`

Differential Revision: D37612064

fbshipit-source-id: 5da9304c93e45c92caa185361024b545c82fb4c4
hphp/hack/src/typing/typing_object_get.ml
hphp/hack/test/holes/null_member_read_nullable.php [new file with mode: 0644]
hphp/hack/test/holes/null_member_read_nullable.php.holes.exp [new file with mode: 0644]