I think env should be preserved out of do_naming
commitf0c0961a1d26e6c010af4d003c6d7008157e73a2
authorLucian Wischik <ljw@fb.com>
Tue, 14 Sep 2021 06:39:51 +0000 (13 23:39 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 14 Sep 2021 06:42:26 +0000 (13 23:42 -0700)
tree46e9f4513e8ef95b28efd17c9dd8fbebbcf69799
parent49167bb47c33d6afb2c77471c512b35a936724d7
I think env should be preserved out of do_naming

Summary:
Error streaming was introduced in D29454477 (https://github.com/facebook/hhvm/commit/6805e3fbe5e5ced2cd3ecbf1ab49418839d81f7f). A comment on that diff says:

> This is to mirror the signature of do_naming, do_typing, do_decling and so on. These never access env.errorl. env.errorl is read at the beginning of the outer function, is threaded through do_parsing, do_naming, do_typing, etc., then is put back into env.errorl.

But looking at the code, I think that env is in fact NOT being threading out of do_naming. The result would be that env isn't aware we've already pushed out some "duplicate name" errors.

Reviewed By: CatherineGasnier

Differential Revision: D30882983

fbshipit-source-id: fc1acf88dc21ab48730100db25fba6da0e13089e
hphp/hack/src/server/serverTypeCheck.ml