Fix array refinement bug
commit75ce1804d2935b9c305d71191c67d19083e84f81
authorAndrew Kennedy <akenn@fb.com>
Thu, 30 Apr 2020 11:03:03 +0000 (30 04:03 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 30 Apr 2020 21:24:58 +0000 (30 14:24 -0700)
treeeb697c3601885d71ffe0a2a06e50b46330175446
parent9986d5c83aaa0404e874bfd3f284441627eb6bf7
Fix array refinement bug

Summary:
The refinement in `is_array` tests does the wrong thing when the static type of the variable under inspection is not concrete e.g. a type parameter. Fix is to add implied constraints only on concrete types, as with `is` tests.

Future: we should unify the code for `is` and `is_array`, `is_dict`, etc tests. There is a lot of commonality.

Reviewed By: CatherineGasnier

Differential Revision: D21282430

fbshipit-source-id: 3e55e86b09bbb819e19d47d1e0c802924ab747bd
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/isarray/isarray_bug.php [new file with mode: 0644]
hphp/hack/test/typecheck/isarray/isarray_bug.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/isarray/isarray_bug.php.like_types.exp [new file with mode: 0644]