Class get
commit800cffe6fdb8797266addc435d1b29ed2a4858a7
authorJames Wu <jjwu@fb.com>
Wed, 1 Sep 2021 17:13:01 +0000 (1 10:13 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 1 Sep 2021 17:28:08 +0000 (1 10:28 -0700)
tree3baf8d4d28466bcc6a4efc82e62e185db2cd603c
parentc84638f6926f215e989ffd9fada92fee7b1294ad
Class get

Summary:
This diff enforces that readonly static variables must be enclosed in a readonly expression when used as an rval expression.

I did not implement this for the typechecker, so I added it on both.

Reviewed By: kavoor

Differential Revision: D30373363

fbshipit-source-id: 462ed1997904cc69e6614c4acd3bc3fa9fa08943
15 files changed:
hphp/hack/src/hhbc/hhbc_by_ref/emit_expression.rs
hphp/hack/src/typing/tast_check/readonly_check.ml
hphp/hack/test/typecheck/readonly/class_get_readonly.php [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/class_get_readonly.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/class_get_readonly.php.legacy_decl.exp [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/class_get_readonly.php.like_types.exp [new file with mode: 0644]
hphp/hack/test/typecheck/readonly/prop.php
hphp/hack/test/typecheck/readonly/prop.php.exp
hphp/hack/test/typecheck/readonly/prop.php.legacy_decl.exp
hphp/hack/test/typecheck/readonly/prop.php.like_types.exp
hphp/hack/test/typecheck/readonly/static_prop.php.exp
hphp/hack/test/typecheck/readonly/static_prop.php.legacy_decl.exp
hphp/hack/test/typecheck/readonly/static_prop.php.like_types.exp
hphp/test/slow/readonly/class_get_readonly.php [new file with mode: 0644]
hphp/test/slow/readonly/class_get_readonly.php.expectf [new file with mode: 0644]