Better error messages for non-object accessnightly-2021.01.29
commitb419c9babf0d03dc7aabbf986b4ef9d7ced68bef
authorVassil Mladenov <vmladenov@fb.com>
Fri, 29 Jan 2021 00:57:20 +0000 (28 16:57 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 29 Jan 2021 01:01:46 +0000 (28 17:01 -0800)
tree900ba287383b49dd74913fae29f728f0d5a5ff0e
parentac99e45f61c312ef072a3cf886ef246195709669
Better error messages for non-object access

Summary: The non_object_member error would previously refer to a type constant as a property because of the binary ~is_method argument. There's already a polymorphic variant `class_member_kind` used for static members that is used elsewhere in Errors, so I extended it to cover methods and properties and used that.

Reviewed By: losvald

Differential Revision: D26120916

fbshipit-source-id: 31b8d254f38b21456ab1fdef494c549357388a53
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors.mli
hphp/hack/src/typing/typing_object_get.ml
hphp/hack/src/typing/typing_taccess.ml
hphp/hack/test/typecheck/coeffects/varray_darray_const_ctx_bad.php.exp
hphp/hack/test/typecheck/nonnull/accessing_type_constant_of_nonnull.php.exp
hphp/hack/test/typecheck/tconst/access_expand_error_1.php.exp
hphp/hack/test/typecheck/tconst/disallow_access_on_nullable.php.exp