better detection of early solve failure
commit69659cad6493706f130bbb945988b969544426f4
authorCatherine Gasnier <catg@fb.com>
Fri, 22 Nov 2019 11:56:05 +0000 (22 03:56 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 22 Nov 2019 11:57:54 +0000 (22 03:57 -0800)
tree1759a7e0970da46ab6a671d2f2805c5183974522
parent6565533f80e67e741d4aba7e82ec2fb23df20e66
better detection of early solve failure

Summary: In expand_type_and_solve, we detect whether we solve invariant type variables to nothing. The logic however is brittle. For example, if the type at hand is (#1 & nonnull) and #1 gets solved to nothing, it would fail to detect it, and therefore fail to fail. Same goes if the type at hand is (#1 | #2).

Reviewed By: andrewjkennedy

Differential Revision: D18635991

fbshipit-source-id: 33ce9d1b0630b1a8bf01ecdccf8d05363ce16072
hphp/hack/src/typing/typing_solver.ml
hphp/hack/test/typecheck/early_solve_inter.php [new file with mode: 0644]
hphp/hack/test/typecheck/early_solve_inter.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/early_solve_inter.php.like_types.exp [new file with mode: 0644]
hphp/hack/test/typecheck/early_solve_inter2.php [new file with mode: 0644]
hphp/hack/test/typecheck/early_solve_inter2.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/early_solve_inter2.php.like_types.exp [new file with mode: 0644]