Move inout check to nast_check
commitc0f685832faeca511523924f75d2e6b93ed78a55
authorKaty Voor <voork@fb.com>
Tue, 18 Jun 2019 19:06:48 +0000 (18 12:06 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 18 Jun 2019 19:16:48 +0000 (18 12:16 -0700)
tree0c46035c82981a0c7f26ae904d81852d59193b28
parent5580eaa0d27bdfde7e26408d4932ded6d50fd116
Move inout check to nast_check

Summary:
Moves check of inout expression to nast_check.
The nast_check visitor appears to traverse a different tree than nastCheck.
This is evidenced by $this and $$ appearing in the tree traversed by nast_check, and not appearing in the tree traversed by nastCheck.

A pattern was added to test for these cases. The tests for these cases are:
- $this : test/typecheck/inout/bad_inout_use_this.php
- $$     : test/typecheck/inout/bad_inout_use_pipe_var.php

Finally, in test case bad_inout_use_arg11.php, the errors thrown were reordered. When testing with a higher number of maximum errors, the previous expected error was thrown after.

Reviewed By: kmeht

Differential Revision: D15864177

fbshipit-source-id: 993beabb96e6dcf06f801cbdddcf76508ff2cc0c
hphp/hack/src/typing/nastCheck.ml
hphp/hack/src/typing/nast_check/inout_check.ml
hphp/hack/test/typecheck/inout/bad_inout_use_arg11.php.exp