Typecheck the `finally` block with the right continuations.
commit22b3ab8a38a84bc8ea2f83128e022163161d1ba7
authorCatherine Gasnier <catg@fb.com>
Fri, 29 Jul 2022 18:53:29 +0000 (29 11:53 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 29 Jul 2022 18:53:29 +0000 (29 11:53 -0700)
treec74b30bf3cf764f62ea49fb939e556df68068246
parent0bb58a4932bf90608fcb4dcb50258273841ecad0
Typecheck the `finally` block with the right continuations.

Summary:
It turns out not all continuations should be used to typecheck the `finally` block. For example the `do` continuation should not be used because `do` statements don't cause the control flow to jump to the finally block like a `break` statement would.

This diff fixes that.

There are a few refactorings, renamings and type annotations in this diff as well.

Reviewed By: losvald

Differential Revision: D38137536

fbshipit-source-id: 2f3df0885a953ce5fa3ee9b09fc4e13715e03f3b
hphp/hack/src/typing/typing.ml
hphp/hack/src/typing/typing_cont_key.ml
hphp/hack/src/typing/typing_per_cont_env.ml
hphp/hack/src/typing/typing_per_cont_env.mli
hphp/hack/src/typing/typing_try.ml
hphp/hack/src/typing/typing_try.mli
hphp/hack/test/typecheck/control_flow/do_while_finally.php.exp
hphp/hack/test/typecheck/control_flow/try_do.php [new file with mode: 0644]
hphp/hack/test/typecheck/control_flow/try_do.php.exp [new file with mode: 0644]