Give a helpful error on locals with type annotations
commit70190a93d630aaec5b01de3c588b7e000a1712df
authorWilfred Hughes <wilfred@fb.com>
Tue, 28 Jan 2020 15:58:52 +0000 (28 07:58 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 28 Jan 2020 16:00:46 +0000 (28 08:00 -0800)
tree4196d22bd6c4d25f50d3b9757836b354ad383bc9
parente80fdebb60f74ef23ba49129c02034533197d78d
Give a helpful error on locals with type annotations

Summary: Users from C++/Java/etc backgrounds expect `int $x = 1;` to be legal Hack. Provide a specific error message in this situation.

Differential Revision: D19449318

fbshipit-source-id: 0a6ab3f475bff8e94b3940c9335269f2d8740e9d
hphp/hack/src/parser/core/parser_trait.rs
hphp/hack/src/parser/core/statement_parser.rs
hphp/hack/src/parser/syntax_error.rs
hphp/hack/test/full_fidelity/cases/local_with_type.php [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/local_with_type.php.errors.exp [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/local_with_type.php.sexp.exp [new file with mode: 0644]