Set variance and solve type variables for await statement
commit577559df51dfe7a382dd4db3fca1dc1ca735f962
authorAndrew Kennedy <akenn@fb.com>
Wed, 28 Nov 2018 03:37:33 +0000 (27 19:37 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 28 Nov 2018 03:40:02 +0000 (27 19:40 -0800)
tree13d138250f0ec21d2674f4d90a8cac63c80dd14e
parent18d49c88bbb33b62212f639b62d5daff37d690d7
Set variance and solve type variables for await statement

Summary:
When checking `await` statements we generate a fresh variable to construct the type `Awaitable<v>` and then check this against the type of the expression.
We need to set the variance (it will turn out to be covariant) and solve accordingly.

Reviewed By: CatherineGasnier

Differential Revision: D13176942

fbshipit-source-id: 12f43511123419abb564814c8fb91290f89ad4f7
hphp/hack/src/typing/typing_async.ml
hphp/hack/test/typecheck/new_inference/await_then_invoke.php [new file with mode: 0644]
hphp/hack/test/typecheck/new_inference/await_then_invoke.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/new_inference/tparam_constraints2.php.exp