Check coeffects on __clonenightly-2020.12.22
commit03ada6dee60734fed378fa4220f89a08fd395e14
authorVassil Mladenov <vmladenov@fb.com>
Tue, 22 Dec 2020 02:11:54 +0000 (21 18:11 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 22 Dec 2020 02:13:59 +0000 (21 18:13 -0800)
tree32f8f1e1b0b87188e497ecb5704f9a4c1ebaf463
parenta2c720cf3e9ee76e61fed304987469d45b233120
Check coeffects on __clone

Summary: This changes the code for clone from a simple subtype against `Tobject` to an invocation of the method `__clone()`, and I've added a default implementation of `__clone` typed as pure for classes that don't define clone.

Reviewed By: DavidSnider

Differential Revision: D25651350

fbshipit-source-id: 5b580411ee8dcdac0b09508835c94c5827eec06f
hphp/hack/src/typing/typing.ml
hphp/hack/src/typing/typing_object_get.ml
hphp/hack/test/typecheck/clone_on_nonobject.php.exp
hphp/hack/test/typecheck/coeffects/clone.php [new file with mode: 0644]
hphp/hack/test/typecheck/coeffects/clone.php.exp [new file with mode: 0644]