Move detection of empty and isset usage in strict mode from inference phase to TAST...
commitf32a42815889ef828204199ec11a12d7ba764b84
authorGiovanni Cappellotto <gcappellotto@fb.com>
Wed, 5 Dec 2018 21:37:22 +0000 (5 13:37 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 5 Dec 2018 21:41:22 +0000 (5 13:41 -0800)
tree4f5e4f0cd911a758a66112cac98362617bdf1d3c
parent4c7bada858dd034422a746d79cf90392ee65c6a4
Move detection of empty and isset usage in strict mode from inference phase to TAST check phase

Summary:
In strict mode, we forbid uses of the special PHP pseudofunctions `isset` and `empty`, which are unfriendly to static analysis.

Before this update this check was done during the inference phase (i.e., `typing.ml`).

The new `Pseudofunctions_check` handler moves the check for special PHP pseudofunctions `isset` and `empty` out of inference and into a separate, post-inference pass on the typed AST.

Differential Revision: D13334673

fbshipit-source-id: 58eea75f60a60e9f7bfdbcbb33ca8d1c9f9014be
hphp/hack/src/typing/tast_check/pseudofunctions_check.ml [new file with mode: 0644]
hphp/hack/src/typing/tast_check/tast_check.ml
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/no_empty_in_strict_mode.php.exp
hphp/hack/test/typecheck/no_isset_in_strict_mode.php [new file with mode: 0644]
hphp/hack/test/typecheck/no_isset_in_strict_mode.php.exp [new file with mode: 0644]