Flag array assignments to undefined variables as errors
commit952037de981429ae2a48eb6a2643e4fa0827bb4b
authorSasha Manzyuk <manzyuk@fb.com>
Thu, 25 Oct 2018 15:22:32 +0000 (25 08:22 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 25 Oct 2018 15:25:04 +0000 (25 08:25 -0700)
tree4a5543094c6a1c6577dde6fd72c0ee3d7c4b3ae2
parent6c3b04a683b5e686cb4930fee6f18adeb4a093b1
Flag array assignments to undefined variables as errors

Summary: When type-checking an array assignment to a variable, check that the variable is defined (see the new test case below).

Reviewed By: Wilfred

Differential Revision: D10852475

fbshipit-source-id: 206bbbbe81f94dd8e9621c9799841413f3552724
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/array_assign_undefined_var.php [new file with mode: 0644]
hphp/hack/test/typecheck/array_assign_undefined_var.php.exp [new file with mode: 0644]