Fix the recent fix of unification of Tvar's
commit6cf34c35b7e852ae9d7f8aac5e83305695edb1bd
authorSasha Manzyuk <manzyuk@fb.com>
Wed, 25 Apr 2018 10:57:35 +0000 (25 03:57 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 25 Apr 2018 11:05:06 +0000 (25 04:05 -0700)
tree2850af81222d1fd6542cb9e8a88741504a5d1eda
parent70f3b2444df7a8d9a3deb091d6014c3654014fcf
Fix the recent fix of unification of Tvar's

Summary: I fixed unification of `Tvar`s in D7653566 but made a mistake: when solving unification of `#n : t` with `(#n | t1 | t2 | ... | tk)`, we were supposed to introduce a fresh variable `#m`, bind it to the singleton unresolved `(t)`, and bind `#n` to `(#m | t1 | t2 | ... | tk)`.  Instead the code bound `#n` to `((t) | t1 | t2 | ... | tk)`.  Not sure if this //really// matters because in the former, correct case `#m` occurs only under the unresolved bound to `#n` and so probably cannot grow independently, but for consistency I've chosen to bring the code with agreement with the comments.

Differential Revision: D7686261

fbshipit-source-id: ec789c4a0cb5e4b63356d89e3669d8bcdff3b8f4
hphp/hack/src/typing/typing_unify_recursive.ml
hphp/hack/src/typing/typing_utils.ml