Null coalesce assignment member op test coverage
commit344c6e1f48070503aadf3814aad04528ed3db8be
authorKaty Voor <voork@fb.com>
Fri, 4 Jun 2021 23:49:00 +0000 (4 16:49 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 4 Jun 2021 23:50:41 +0000 (4 16:50 -0700)
tree0b72e42c6b3bb9d54f7979fe236908cf5d298526
parent50eab2ca31d1081b1b0947f356319bc6098fe8c8
Null coalesce assignment member op test coverage

Summary:
We have very minimal test coverage of null coalesce assignment instructions when the lhs is a member-op chain. Had to debug a couple flib tests that we should've caught in our own testing.

This diff adds tests for all the different bases an Elem->SetElem (null coalesce assignment) path in member-operations.h can expect.
This will also ensure the behavior doesn't change between this diff and the next diff when the bytecode changes.

If we do move NullCoalesce to be a SetOp rather than currently elem/setElem path, we need to make sure the read of the lhs generates the same warnings/fatals as we currently do. There are some subtle differences between setop + elem->setElem paths. This diff aims to also emit the warnings Elem() can currently generate.

Reviewed By: oulgen

Differential Revision: D28525954

fbshipit-source-id: cbe1f3d69205f8e29cdb26f6ef79ea2ace1e3916
hphp/test/slow/null_coalesce_assignment/null_coalesce_assignment_member_op.php [new file with mode: 0644]
hphp/test/slow/null_coalesce_assignment/null_coalesce_assignment_member_op.php.expectf [new file with mode: 0644]