Make type refinement by Shapes::keyExists tests work in the new inference algorithm
commit47ef745da7538570a61a55b1d5170b95b355b1f1
authorSasha Manzyuk <manzyuk@fb.com>
Tue, 22 Jan 2019 14:17:02 +0000 (22 06:17 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 22 Jan 2019 14:20:27 +0000 (22 06:20 -0800)
tree7714ca656a2a863d7572f71fec5d62d28b52e1b0
parentd079a57b4d4d42feda30e6a4783ae51f6e5bfde3
Make type refinement by Shapes::keyExists tests work in the new inference algorithm

Summary: At the moment, type refinement by a `Shapes::keyExists` check doesn't work in the new inference algorithm if the type of the shape argument is a type variable.  A simple fix is to eagerly solve for the type variable before applying the refinement logic.

Reviewed By: andrewjkennedy

Differential Revision: D13761344

fbshipit-source-id: 04b59fcb27e83e55f078433261b820af1b909eec
hphp/hack/src/typing/typing_shapes.ml
hphp/hack/test/typecheck/new_inference/eager_solve/shapes_key_exists.php [new file with mode: 0644]
hphp/hack/test/typecheck/new_inference/eager_solve/shapes_key_exists.php.exp [new file with mode: 0644]