Remove redundant parameter type checks during closure checking
commit0d26915e02a4b46b574b5f44d6a786df8e0725fa
authorAndrew Kennedy <akenn@fb.com>
Wed, 31 Aug 2022 00:37:10 +0000 (30 17:37 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 31 Aug 2022 00:37:10 +0000 (30 17:37 -0700)
tree79ad9d15dd52fcaf8ce38bda28a77fb112c8ca2b
parent15bc6cecb396c1eb7d5329e1dfd0d8cd71b51570
Remove redundant parameter type checks during closure checking

Summary:
When checking lambdas and anonymous functions, we perform some redundant checking of explicit type hints against the type that has been constructed for the parameter (e.g. from the expected type). It seems that this code is a hangover from when (years ago) we checked lambda definitions against their application sites.

New test for Sound Dynamic, which was rejected (wrongly) prior to this diff.

It looks like there is a bunch more cleanup we can do for lambdas and lambda parameters, which I will leave for future diffs.

Reviewed By: vassilmladenov

Differential Revision: D39130178

fbshipit-source-id: 818defcb5ea783af2b9f493057d917a008d6eedb
hphp/hack/src/typing/typing.ml
hphp/hack/test/sound_dynamic/typing/lambda_variadic.good.php [new file with mode: 0644]
hphp/hack/test/sound_dynamic/typing/lambda_variadic.good.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/functional_higher_order2.php.tgt_pess_disabled [deleted file]
hphp/hack/test/typecheck/tconst/explicitly_typed_lambda.php.tgt_pess_disabled [deleted file]
hphp/hack/test/typecheck/typehole/T66283164.php.tgt_pess_disabled [deleted file]