Move __Const checks from nast check to parsing
commit8f89f2c0d7be26e5821e715909b06b861e56692a
authorKaty Voor <voork@fb.com>
Sat, 27 Jul 2019 05:31:37 +0000 (26 22:31 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Sat, 27 Jul 2019 05:36:06 +0000 (26 22:36 -0700)
tree398d4577b9f640ae92ac7a5856a465ed3ec8a9f9
parentb09680ccb7b7ab196d9f70f2506ba607359b40f6
Move __Const checks from nast check to parsing

Summary:
- Non const classes can extend __Const classes
- Moved disallow abstract final class check to parsing
- Removed redundant 'disallow __Const on traits, interfaces, and enums' check from nast check

- The case Crecord in NastCheck currently has no error-checking during parsing. It also currently will never parse a __ Const attribute as 'missing' is passed in along every parsing path for parse_record_declaration. I made a post on Hacklang Engineering to see if the plan is to further deprecate these or whether we need to add any checks on them.

Reviewed By: alexeyt

Differential Revision: D16522670

fbshipit-source-id: 26ffa1cce177bb2e6a719ffcf4132afa52eb7342
12 files changed:
hphp/hack/src/errors/error_codes.ml
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors.mli
hphp/hack/src/parser/full_fidelity_parser_errors.ml
hphp/hack/src/parser/full_fidelity_syntax_error.ml
hphp/hack/src/parser/full_fidelity_syntax_error.mli
hphp/hack/src/typing/nast_check/const_prohibited_check.ml
hphp/hack/src/typing/typing.ml
hphp/hack/test/errors/error_map.ml
hphp/hack/test/typecheck/const_attribute/usage/class.php.exp
hphp/hack/test/typecheck/const_attribute/usage/subclass_not_const.php.exp
hphp/hack/test/typecheck/const_attribute/usage/trait.php.exp