Correctly check SDT lambda under dynamic assumptions
commit6c810fce0547903307dfbfdf77b7e590b3c9a275
authorAndrew Kennedy <akenn@fb.com>
Wed, 8 Dec 2021 17:44:57 +0000 (8 09:44 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 8 Dec 2021 17:46:46 +0000 (8 09:46 -0800)
treeebc5ec0fc10a9d5342dc4e50d19c45d328b34448
parent6c67eb13286c731f454fcc194821f0a1a304911f
Correctly check SDT lambda under dynamic assumptions

Summary: Checking of SDT lambdas under dynamic assumptions was broken, because the environment used to kick off the check was captured *after* the first check under static types, which leaves continuation typings as they are at the end of checking the body! Instead, we should capture the environment as set up just *before* the first check.

Reviewed By: vassilmladenov

Differential Revision: D32917321

fbshipit-source-id: 8ee8e4c508be7efebf28297ac0c9123362bb7bfc
hphp/hack/src/typing/typing.ml
hphp/hack/test/sound_dynamic/typing/sdt_lambda.bad.php
hphp/hack/test/sound_dynamic/typing/sdt_lambda.bad.php.exp
hphp/hack/test/sound_dynamic/typing/sdt_lambda.good.php
hphp/hack/test/sound_dynamic/typing/sdt_lambda.php [new file with mode: 0644]