Fix bug with nullable member selection not erroring
commit410661ff03327dd527508bc74ef907209f08593c
authorJames Wu <jjwu@fb.com>
Fri, 10 Dec 2021 21:41:45 +0000 (10 13:41 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 10 Dec 2021 21:43:37 +0000 (10 13:43 -0800)
treecd2503345e01484356bb3809824e1537654a15ec
parent66c594a63de5e87756fbcd06701f24ecbdfd9b2e
Fix bug with nullable member selection not erroring

Summary:
Nullable member selection wasn't erroring in the typechecker, because I was under the impression that nullable fields would go to Tunion(Tnull, ty), not Toption, but that's not necessarily true.

This still errors at runtime, so it's an easy typechecker only fix.

Reviewed By: oulgen

Differential Revision: D33000127

fbshipit-source-id: b8ef115bdade451f892f549bd12f466f8ac52895
hphp/hack/src/typing/tast_check/readonly_check.ml
hphp/hack/test/typecheck/readonly/safe_member_selection.php [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/safe_member_selection.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/safe_member_selection.php.legacy_decl.exp [new file with mode: 0644]