Account for implicit params in tyvar variance
commit0057daf026accb32ec07c8f5d0831fa213c84eb4
authorAndrew Kennedy <akenn@fb.com>
Fri, 18 Feb 2022 08:23:53 +0000 (18 00:23 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 18 Feb 2022 08:25:27 +0000 (18 00:25 -0800)
tree92d6fc1bbcf119aa268a39fffae5eba5436c7830
parent09d5472daf087ea0806c1c8d6d036ad7b4205b03
Account for implicit params in tyvar variance

Summary: Type variables corresponding to implicit (capability) parameters are currently missed in the variance calculation used for type inference, leading to early solving to lower bounds, typically `nothing`. Easy fix in the variance calculation - see test for code that now passes but used to be rejected before this change.

Reviewed By: losvald

Differential Revision: D34305049

fbshipit-source-id: 2ed2741e43f660b24aefe9db4fda3dd290c6120c
hphp/hack/src/typing/typing_env.ml
hphp/hack/test/typecheck/coeffects/higher_order_ctx_function_2.php [new file with mode: 0644]
hphp/hack/test/typecheck/coeffects/higher_order_ctx_function_2.php.exp [new file with mode: 0644]