Add aast_check to require explicit coeffect annotations on local functions
commite24df2edabfd80c27e202aecafc255c679ba66df
authorJames Wu <jjwu@fb.com>
Wed, 17 Nov 2021 23:34:42 +0000 (17 15:34 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 17 Nov 2021 23:36:06 +0000 (17 15:36 -0800)
treed4c7f44eb58b31d534f490c2d8b42a76ad8fc1ec
parentfb10443e746ffe177bda133fe5b2c68c8e30727f
Add aast_check to require explicit coeffect annotations on local functions

Summary:
This adds a parsing error similar to InferredLambdaContextInPoliciedLocalLintRuleTest.php to require developers to explicitly annotate closures within policied local contexts.

I'm fully aware that this is a bit of tech debt when combined with mchen110's work on coeffects_check.rs, but I didn't want to create a bunch of merge conflicts for a typechecker only check, so I added them here for now. I'll move them over to coeffects_check.rs once refactorings are a bit more stable.

Reviewed By: rodmk

Differential Revision: D32307929

fbshipit-source-id: dd3af4abda3ba66f4649817291a9641ee3a96398
hphp/hack/src/parser/aast_check.rs
hphp/hack/src/parser/aast_parser.rs
hphp/hack/src/parser/syntax_error.rs
hphp/hack/test/typecheck/policied_local_funs.php [new file with mode: 0644]
hphp/hack/test/typecheck/policied_local_funs.php.exp [new file with mode: 0644]