Function calls
commit70f7a4a2edb0f142588d04332edbf76066fe8187
authorJames Wu <jjwu@fb.com>
Thu, 11 Feb 2021 18:24:48 +0000 (11 10:24 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 11 Feb 2021 18:30:17 +0000 (11 10:30 -0800)
tree33e104064e2ad046534990917113c1b45cead9c5
parent88435507363df69d7d7f60fb3bd5625f95658753
Function calls

Summary:
This adds 3 new checks:

- Readonly function calls need to have args subtype
- Function calls that return readonly need to be wrapped in readonly
- Readonly expressions can only call readonly methods

Reviewed By: zilberstein

Differential Revision: D26377896

fbshipit-source-id: 2b4eeececc3c67253ad09deedd14e16adc51a5ea
13 files changed:
hphp/hack/src/errors/error_codes.ml
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors.mli
hphp/hack/src/oxidized/gen/error_codes.rs
hphp/hack/src/typing/tast_check/readonly_check.ml
hphp/hack/test/typecheck/readonly/args.php [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/args.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/basics.php
hphp/hack/test/typecheck/readonly/basics.php.exp
hphp/hack/test/typecheck/readonly/call.php [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/call.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/explicit_ro_cast.php [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/explicit_ro_cast.php.exp [new file with mode: 0644]