Partially move methods returning `this` in Hack Collections to PHP
commitae94bb6241619c742f146c66140bea1013d95805
authorHunter Goldstein <hgoldstein@fb.com>
Tue, 19 Jul 2022 16:24:33 +0000 (19 09:24 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 19 Jul 2022 16:24:33 +0000 (19 09:24 -0700)
tree08d7f8b52270086370d39e21fcc2d748c06a492b
parent6b76d8a440276f6c497bca2fe5eafc851cfc8463
Partially move methods returning `this` in Hack Collections to PHP

Summary:
I had originally done this to unblock typing some native functions that return `this`; I realized I don't *need* to do such, but I noticed that this was net less code and avoids relying on "all unknown types are `KindOfObject`."

This pushes the Hack Collection builtins that return `$this` slightly into userland. All of them are replaced with wrappers that call a native function returning `void` (doing any mutation needed) and then immediately returning `$this`.

Reviewed By: ricklavoie

Differential Revision: D37657963

fbshipit-source-id: 6ddca5d09f6892bf968955f81b2140f720fd32e2
13 files changed:
hphp/hhbbc/interp.cpp
hphp/hhbbc/type-builtins.cpp
hphp/hhbbc/type-builtins.h
hphp/runtime/ext/collections/ext_collections-map.cpp
hphp/runtime/ext/collections/ext_collections-map.h
hphp/runtime/ext/collections/ext_collections-map.php
hphp/runtime/ext/collections/ext_collections-set.cpp
hphp/runtime/ext/collections/ext_collections-set.h
hphp/runtime/ext/collections/ext_collections-set.php
hphp/runtime/ext/collections/ext_collections-vector.cpp
hphp/runtime/ext/collections/ext_collections-vector.h
hphp/runtime/ext/collections/ext_collections-vector.php
hphp/runtime/vm/jit/irgen-builtin.cpp