fix regression in completeness due to removing remove_equivalent_tyvars
commitff1f8f04b18861b6a58591e85f5baef3a45cb382
authorCatherine Gasnier <catg@fb.com>
Thu, 21 Mar 2019 14:50:08 +0000 (21 07:50 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 21 Mar 2019 14:53:52 +0000 (21 07:53 -0700)
tree876c2ee70d8bcb4354aff5fa4ccf005d7094682f
parent8489f83e5d7429b98ea99b8a32e9a58a3060637a
fix regression in completeness due to removing remove_equivalent_tyvars

Summary:
See the added test for how the regression was caused. Basically, we now have constraints sets like:
```
C, #1 <: #2 <: #1
C, #2 <: #1 <: #2
```
so when `expand_type_and_solve`ing #2, we would fail to solve it to C.
Solution in this diff: `solve_tyvar` now recursively solve until we get a concrete type.

Reviewed By: andrewjkennedy

Differential Revision: D14438531

fbshipit-source-id: aee3ca20c7aedd8197aaa87924712af5b9d33b7b
hphp/hack/src/typing/typing_subtype.ml
hphp/hack/test/typecheck/new_inference/eager_solve/regression_remove_remove_equiv_tyvars.php [new file with mode: 0644]
hphp/hack/test/typecheck/new_inference/eager_solve/regression_remove_remove_equiv_tyvars.php.exp [new file with mode: 0644]