Fix up closure convert
commit3308302b1c3d2085edabdb52a3d3420562b31672
authorThomas Jiang <thomasjiang@fb.com>
Wed, 11 Nov 2020 04:18:57 +0000 (10 20:18 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 11 Nov 2020 04:20:51 +0000 (10 20:20 -0800)
tree011553b005b51acff5872f7dd878a2e9e4f7cc6e
parentf6e84308dffdb1a7262ab716bc7c2d3029f53a29
Fix up closure convert

Summary:
When testing compilation of a couple of files, noticed that hh_single_compile would crash.

Eventually I figured out that this was due to the fact that we were attempting to compile `ETSplice(_)` nodes in `emit_expression.rs` for some reason.

I guess our current runtime tests do not test the cases where we have splice nodes created by `__splice__()` in an Expression Tree. The problem is that the logic in closure_convert ends up default recursing on both the original and the desugared expression tree, causing lingering `ETSplice` nodes in compilation.

This diff changes the logic in `closure_convert.rs` to only recurse on the desugared expression tree.

Reviewed By: Wilfred

Differential Revision: D24838679

fbshipit-source-id: b732196fe555a3df425d85699f0d7e60b013ccbb
hphp/hack/src/hhbc/closure_convert.rs
hphp/test/slow/expression_trees/splice.php [new file with mode: 0644]
hphp/test/slow/expression_trees/splice.php.expect [new file with mode: 0644]
hphp/test/slow/expression_trees/splice.php.hphp_opts [new file with mode: 0644]
hphp/test/slow/expression_trees/splice.php.opts [new file with mode: 0644]