Improve typing of arrays containing untyped values
commitf8f652bd860dce781c27080eddffb3a1b98c4a34
authorSasha Manzyuk <manzyuk@fb.com>
Tue, 26 Jun 2018 14:22:11 +0000 (26 07:22 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 26 Jun 2018 14:27:50 +0000 (26 07:27 -0700)
tree2b10defe00a63884114210fb73eb45315e845d4e
parentd35c85dbf9a2b8c1178ee22231c72a7271d02d7f
Improve typing of arrays containing untyped values

Summary: When typing an array literal, if one of the values is untyped (i.e., has type the "any" type `_`), then we consider the entire array untyped (i.e., give it the value type `_`), but we do not check if the typed elements of the array have the types compatible with the expected type passed down from the context.  This diff fixes this.

Reviewed By: CatherineGasnier

Differential Revision: D8537974

fbshipit-source-id: e9ff6df8613bddcd10b965448508be5226d2a49b
hphp/hack/src/typing/typing.ml