Type expression tree as the result of inferring the desugared code
commit2297bf2ec7c5a056fba198de7685dcc357cea3d7
authorThomas Jiang <thomasjiang@fb.com>
Thu, 15 Oct 2020 15:43:27 +0000 (15 08:43 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 15 Oct 2020 15:49:31 +0000 (15 08:49 -0700)
treed264fe0f32e4279c9706f4241011ecbc9a0ff197
parent79ae80b19a85d94c427092e6aa33d3e43e10658b
Type expression tree as the result of inferring the desugared code

Summary:
Right now, in the TAST, we are typing the original expression within the expression tree and assigning that to the ExprTree node. Thus:

```
Code`4 + 4`
```
is typed as an int.

This is not what the type of this expression should be. Instead, we should type the result of this expression as the result of typing the desugared code. So we should think that

```
Code`4 + 4`
```
is an `ExprTree<..., ...>`

Reviewed By: Wilfred

Differential Revision: D24281227

fbshipit-source-id: 665a3ee2db5e54a7d63b3b535fa4f85c369bc8c7
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/expression_trees/hover_type.php [new file with mode: 0644]
hphp/hack/test/typecheck/expression_trees/hover_type.php.exp [new file with mode: 0644]