Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Move checks that can be parse-checks into the parser
Summary: The check for sealed final already existed and wasn't needed in decl. The check for sealed enum doesn't really need to be in decl and should just be a straight up parse error. Reviewed By: vladima Differential Revision: D13151408 fbshipit-source-id: 5441a5b1c8de2a64283990f3e3181e63524af1ae
- Loading branch information
Showing
with
43 additions
and 51 deletions.
- +7 −17 hphp/hack/src/decl/decl.ml
- +2 −2 hphp/hack/src/errors/error_codes.ml
- +0 −7 hphp/hack/src/errors/errors.ml
- +0 −2 hphp/hack/src/errors/errors_sig.ml
- +25 −11 hphp/hack/src/parser/full_fidelity_parser_errors.ml
- +1 −0 hphp/hack/src/parser/full_fidelity_syntax_error.ml
- +1 −0 hphp/hack/src/parser/full_fidelity_syntax_error.mli
- +2 −2 hphp/hack/test/errors/error_map.ml
- +0 −8 hphp/hack/test/typecheck/sealed/enum.php
- +0 −2 hphp/hack/test/typecheck/sealed/enum.php.exp
- +4 −0 hphp/test/slow/sealed/sealed_classes17.php
- +1 −0 hphp/test/slow/sealed/sealed_classes17.php.expectf
@@ -0,0 +1,4 @@ | ||
<?hh | ||
|
||
<<__Sealed(SomeOtherClass::class)>> | ||
enum SomeSealedEnum: int {} |
@@ -0,0 +1 @@ | ||
Fatal error: Enums cannot be sealed. in %s/hphp/test/slow/sealed/sealed_classes17.php on line 4 |