Add more parse errors for coeffects
commitc03e50656e726cf32dfb2e1186c7a640eb4489e0
authorVassil Mladenov <vmladenov@fb.com>
Thu, 7 Jan 2021 08:30:55 +0000 (7 00:30 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 7 Jan 2021 08:33:01 +0000 (7 00:33 -0800)
tree2bdae6d517c329dd64fca9147ed14270b7d63c0a
parentac7985409e4f683110a6e0af8a8160fddf76e357
Add more parse errors for coeffects

Summary:
This adds a few more parse errors to explain coeffects transformation errors
- error when `$f` doesn't exist given `ctx $f` or `$f::C`, or doesn't have a type hint
- `$f`'s type hint must have exactly the form `(function (tbar)[_]: t)` when `ctx $f` is present
- no projecting type constant off variadic parameter
- error when using polymorphic context on memoized function

Reviewed By: losvald

Differential Revision: D25777157

fbshipit-source-id: bbb0f29dec422563445f622a56d566185ee35328
hphp/hack/hhi/traits.hhi
hphp/hack/src/parser/lowerer/lowerer.rs
hphp/hack/src/parser/syntax_error.rs
hphp/hack/test/nast/coeffects/poly_ctx.php
hphp/hack/test/nast/coeffects/poly_ctx.php.exp
hphp/hack/test/typecheck/coeffects/poly_parse_errors.php [new file with mode: 0644]
hphp/hack/test/typecheck/coeffects/poly_parse_errors.php.exp [new file with mode: 0644]
hphp/test/slow/coeffects/poly_ctx_fun.php