remove Env.remove_equivalent_tyvars
commit8489f83e5d7429b98ea99b8a32e9a58a3060637a
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)
treec5c5a3719603358ead2f6e27b86b616627c3eaee
parent3e9ee3df877a8ed871387274f8c16cb8e6059bc0
remove Env.remove_equivalent_tyvars

Summary:
Calling `remove_equivalent_tyvars` while in the process of converting our props to a type variable graph would cause type variables to be unintentionally readded after having been solved.
`remove_equivalent_tyvars` was originally added in D13234272 to avoid creating cycles in the type variable graph, because we didn't handle those cycles properly in the transitive closure and while solving. Now that we do (we remove the type variable itself from its bounds before solving), we can afford cycles until the type variables are being solved, which will automatically discard the cycles. Therefore we can simply discard the calls to `remove_equivalent_tyvars`.

Reviewed By: andrewjkennedy

Differential Revision: D13783182

fbshipit-source-id: 9b9082535b8916be973e92e934adf984e3d50a54
hphp/hack/src/typing/typing_env.ml
hphp/hack/src/typing/typing_env.mli
hphp/hack/src/typing/typing_subtype.ml
hphp/hack/test/typecheck/new_inference/eager_solve/stack_overflow3.php.exp
hphp/hack/test/typecheck/new_inference/stack_overflow2.php.exp
hphp/hack/test/typecheck/new_inference/transitive_simplify_2.php.exp
hphp/hack/test/typecheck/new_inference/transitive_simplify_2bis.php [new file with mode: 0644]
hphp/hack/test/typecheck/new_inference/transitive_simplify_2bis.php.exp [new file with mode: 0644]