Move redundant nullsafe property access check out of typing.ml
commit001c1677dff75ae0ede537f8449cf5b7729fc65c
authorSasha Manzyuk <manzyuk@fb.com>
Fri, 20 Jul 2018 12:11:11 +0000 (20 05:11 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Fri, 20 Jul 2018 12:26:48 +0000 (20 05:26 -0700)
tree27262169fd704f82a2e74420c79488bdf5345837
parente4c33a09ad79053904ffba9d2c9f2876435a0e9a
Move redundant nullsafe property access check out of typing.ml

Summary: We have a check in `typing.ml` if `?->`, nullsafe property access operator, is used on a value that is guaranteed to not be null.  This check better belongs into a TAST check (and shouldn't be a type error anyway because a value of type `C` can be viewed as a value of type `?C` by subsumption and hence it should be possible to use `?->` on it).

Reviewed By: andrewjkennedy

Differential Revision: D8893174

fbshipit-source-id: ff5d65537c3cb0ae40c3b270e750e1ad39163082
hphp/hack/src/typing/tast_check/redundant_nullsafe_check.ml [new file with mode: 0644]
hphp/hack/src/typing/tast_check/tast_check.ml
hphp/hack/src/typing/tast_utils.ml [new file with mode: 0644]
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/nonnull/nullsafe_member_access_on_nonnull.php.exp
hphp/hack/test/typecheck/nullsafe/nullsafe-call-6.php.exp
hphp/hack/test/typecheck/nullsafe/nullsafe-unresolved-2.php [new file with mode: 0644]
hphp/hack/test/typecheck/nullsafe/nullsafe-unresolved-2.php.exp [copied from hphp/hack/test/typecheck/nullsafe/nullsafe-call-6.php.exp with 50% similarity]