Improve the error message on empty method bodiesnightly-2021.05.14
commitb5fad153c81a3f8d7ac45557d70d173c2253ee23
authorChaoqiang Deng <chaoqiangdeng@fb.com>
Fri, 14 May 2021 02:03:50 +0000 (13 19:03 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 14 May 2021 02:05:11 +0000 (13 19:05 -0700)
treea16d0b5690fd6ca90a27d0cb28245ef917b383f7
parent75b124fcba4e5fa040b2f3a9c41d87c9d4202182
Improve the error message on empty method bodies

Summary: When the body of a non-abstract method is empty, the current error message is either unclear or redundant. To improve it, the message is replaced by a constant string "A method must have a body or be marked `abstract`".

Reviewed By: Wilfred

Differential Revision: D28355460

fbshipit-source-id: 80fea0c7d1bad20a3e7040a5ef7e25a47a9b9644
15 files changed:
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors.mli
hphp/hack/src/parser/rust_parser_errors.rs
hphp/hack/src/parser/syntax_error.rs
hphp/hack/src/typing/tast_check/abstract_class_check.ml
hphp/hack/test/full_fidelity/cases/test_errors_method.php.errors.exp
hphp/hack/test/full_fidelity/cases/test_interface_method_errors.php.errors.exp
hphp/hack/test/typecheck/debug/disable_typechecker.php.exp
hphp/hack/test/typecheck/suggest_method_name.php.exp
hphp/hack/test/typecheck/suggest_method_name2.php.exp
hphp/hack/test/typecheck/suggest_method_name3.php.exp
hphp/hack/test/typecheck/typing_fail_abstract_method2.php.exp
hphp/hack/test/typecheck/typing_fail_visibility.php.exp
hphp/test/zend/good/Zend/tests/errmsg_001.php [deleted file]
hphp/test/zend/good/Zend/tests/errmsg_001.php.expectf [deleted file]