Pessimize bounds on type parameters when substituting wildcard type arguments
commit139cfa40212a07151ac176642bc901cf71bf0488
authorVassil Mladenov <vmladenov@fb.com>
Wed, 26 Jun 2019 04:09:31 +0000 (25 21:09 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 26 Jun 2019 04:17:34 +0000 (25 21:17 -0700)
tree8213f5085ed62e201eb47edd03c27ad01e33cbe6
parent77756554b2cef47f659d9d43143e599111ec9308
Pessimize bounds on type parameters when substituting wildcard type arguments

Summary:
The decl tparams used in the functions that perform substitution of fresh type variables need to be pessimized so that the appropriate bounds are set.

This also prevents a `_` argument from being pessimized into `~_` because it interferes with other code that matches on a `Tapply ((_p, "_"), [])` to handle wildcards.

Reviewed By: Matt-Schellhas

Differential Revision: D15958754

fbshipit-source-id: b96bf5243c17b903dbe4caf1102b094c4fa0f2ce
hphp/hack/src/typing/typing.ml
hphp/hack/src/typing/typing_enforceability.ml
hphp/hack/src/typing/typing_phase.ml
hphp/hack/test/typecheck/like_types/pessimization/as_wildcard.php [new file with mode: 0644]
hphp/hack/test/typecheck/like_types/pessimization/as_wildcard.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/like_types/pessimization/is_wildcard.php [new file with mode: 0644]
hphp/hack/test/typecheck/like_types/pessimization/is_wildcard.php.exp [new file with mode: 0644]