Return early in case of error when emitting switch cases
commit51556a42c15eef52f4004e0e4471e73b8c0cb4e3
authorMillie Chen <milliechen@fb.com>
Tue, 2 Jun 2020 06:27:32 +0000 (1 23:27 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 2 Jun 2020 06:41:33 +0000 (1 23:41 -0700)
treea4f9f537d36d6c41270baeafeb53d7c8456934f9
parente7fd3d07324e5b96d7d4603010932460b7990cd0
Return early in case of error when emitting switch cases

Summary: `emit_switch` emits the last case separate from the rest. When there's an error in both parts, return the error for the first part to match ocaml's behavior

Reviewed By: shiqicao

Differential Revision: D21831072

fbshipit-source-id: ac43f19b118a347b0c0205c71759c169e829e52c
hphp/hack/src/hhbc/emit_statement.rs