Allow Readonly\as_mut to support collections of readonly values
commit3e9038346891257e3c41cc42ea6745037d2ed79e
authorJames Wu <jjwu@fb.com>
Thu, 2 Sep 2021 03:20:08 +0000 (1 20:20 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 2 Sep 2021 03:28:03 +0000 (1 20:28 -0700)
treea63788574b62104c082b6a949108bb82829d2f3d
parent2e07336c36a29a667ca1d7247f2977bba4617646
Allow Readonly\as_mut to support collections of readonly values

Summary:
This amends Readonly_check to allow collections of immutable values instead of only primitives

Note that this will not necessarily solve the Sitevar case without some more typing fixmes because the TVal is not constrained to be a value type.

Reviewed By: viratyosin

Differential Revision: D30690741

fbshipit-source-id: 977836fb56c0d1fff7f2fd7866c6b28dbc5e90ba
hphp/hack/src/errors/errors.ml
hphp/hack/src/typing/tast_check/readonly_check.ml
hphp/hack/test/typecheck/readonly/as_mut_collections.php [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/as_mut_collections.php.exp [new file with mode: 0644]