Ban ::class on RHS of instanceof in hack typechecker
commitfbb68e699851b865921eed82306145b3084491ed
authorJames Wu <jjwu@fb.com>
Thu, 20 Sep 2018 22:45:51 +0000 (20 15:45 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 20 Sep 2018 23:01:15 +0000 (20 16:01 -0700)
tree05359dd2aaeece430036a55d212eee9081c1e543
parentbca9e7ef51549d7d9fcda78ef34cf666bb526aa8
Ban ::class on RHS of instanceof in hack typechecker

Summary: PHP and HackC allows arbitrary expressions in parens on the rightside of an instanceof. This is alright, but we should ban "::class" in the typechecker because the code is redundant.

Reviewed By: oulgen

Differential Revision: D9979008

fbshipit-source-id: a9244001b7b5b65577ee66614747e240cc1d2c04
hphp/hack/src/errors/error_codes.ml
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors_sig.ml
hphp/hack/src/typing/nastCheck.ml
hphp/hack/test/errors/error_map.ml
hphp/hack/test/typecheck/class_in_instanceof.php [new file with mode: 0644]
hphp/hack/test/typecheck/class_in_instanceof.php.exp [new file with mode: 0644]