More accurate is/as linting
commit8087074c8c7c9e30f8877c9957f0ba918f53ca43
authorAndrew Kennedy <akenn@fb.com>
Thu, 18 Nov 2021 17:55:01 +0000 (18 09:55 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 18 Nov 2021 17:56:25 +0000 (18 09:56 -0800)
treede4e9dae5ee6f72c1297ee7e13a8494f256f98c6
parentdfd171477fb010f1d2ca79b1c8fd478593705e74
More accurate is/as linting

Summary:
The linter check for "always false" or "always true" `is` and `as` expressions misses many "always false" expressions, including any that involve interfaces.

More accurate is to use our new "disjoint types" check: if the type of the scrutinee and the type hint in the `is` or `as` expression are disjoint, then the check will never succeed.

Differential Revision: D32496331

fbshipit-source-id: c677e09a2762ca7a7575690b6be8a8baea4934e9
hphp/hack/src/lints/linter_is_checks.ml
hphp/hack/src/lints/lints_errors.ml