Fix constructor handling
commit81db0672d541de54f5e6c78dcbd251598798637f
authorMistral Orhan Jean-Pierre Contrastin <mojpc2@fb.com>
Wed, 30 Dec 2020 12:58:00 +0000 (30 04:58 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 30 Dec 2020 12:59:44 +0000 (30 04:59 -0800)
treee2a3bc93ff91fb0e92c6535b25da1bb50d7c10f9
parent7f02bc586b75b4eda83b2578a03d25e00e7900ef
Fix constructor handling

Summary: We were returning a fresh policy type while handling a constructor call via `new`. This is a bug as all the flow into that object gets lost. This diff fixes it by using the already existing policy type for the newly created object.

Reviewed By: mpu

Differential Revision: D25702252

fbshipit-source-id: ea9faa0ef01b0f0ac1bee10bd1bd280d8531dc4a
hphp/hack/src/ifc/ifc.ml
hphp/hack/test/ifc/check/new_return.php [new file with mode: 0644]
hphp/hack/test/ifc/check/new_return.php.exp [new file with mode: 0644]