New inference: remove redundant type variables from bounds before binding
commit212e9f214716bf89d71fbcc7f593942692bfd928
authorAndrew Kennedy <akenn@fb.com>
Mon, 4 Mar 2019 11:27:23 +0000 (4 03:27 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 4 Mar 2019 11:30:46 +0000 (4 03:30 -0800)
treebcf5a05d10fb66f68b378232c35f12066d18f177
parent9d8c5e279356750ea7b035ac10d2a13eebe9ead2
New inference: remove redundant type variables from bounds before binding

Summary: I'm restoring an earlier optimization that was removed by D14007472 - see comments in code. Where possible we should avoid redundant type variables appearing in unions in tvenv, which add clutter and possible performance degradation. (No tests, but it's possible to see the difference with `hh_show_env()`.)

Reviewed By: kmeht

Differential Revision: D14279014

fbshipit-source-id: 74e4ca5e1ecd2322c0fdbc85dc0ed35520a9791a
hphp/hack/src/typing/typing_subtype.ml