Introduce Terr in place of Tany for type errors
commit31f5e6b2b4d0bc56c5def9f81c6c134c2a80f526
authorAndrew Kennedy <akenn@fb.com>
Thu, 26 Jan 2017 12:11:46 +0000 (26 04:11 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 26 Jan 2017 12:28:43 +0000 (26 04:28 -0800)
treed5b3c30ac5132606bd431961b0677bdfc9d19418
parent20acc0e0a9c1b666c98c905b4862437f9f1e0662
Introduce Terr in place of Tany for type errors

Summary:
The `Tany` type is used for at least three purposes in the type-checker.
1. To represent the absence of type information on parameters or results for functions non-strict files
2. To represent the absence of type information in some typing rules inside the type checker
3. To avoid cascading errors inside the type checker
Going forward, we will be taking type `dynamic` seriously, which is roughly the first two uses above. But it makes sense to separate the third one, introducing a new type `Terr` that is compatible with all other types and so doesn't cause errors to cascade.

For now, `Terr` is treated mostly the same as `Tany` in the code, but in future we will use `Tany` as the representation of `dynamic` and it won't necessarily unify or be treated as compatible with all other types.

Reviewed By: hubyrod

Differential Revision: D3686950

fbshipit-source-id: 2999bcf5b61ee71b3f7f9a6fb641661c5e28304d
23 files changed:
hphp/hack/src/decl/decl_hint.ml
hphp/hack/src/decl/decl_instantiate.ml
hphp/hack/src/decl/decl_pos_utils.ml
hphp/hack/src/decl/decl_utils.ml
hphp/hack/src/typing/coverage_level.ml
hphp/hack/src/typing/type_mapper.ml
hphp/hack/src/typing/type_visitor.ml
hphp/hack/src/typing/typing.ml
hphp/hack/src/typing/typing_async.ml
hphp/hack/src/typing/typing_defs.ml
hphp/hack/src/typing/typing_dependent_type.ml
hphp/hack/src/typing/typing_enum.ml
hphp/hack/src/typing/typing_equality_check.ml
hphp/hack/src/typing/typing_generic.ml
hphp/hack/src/typing/typing_phase.ml
hphp/hack/src/typing/typing_print.ml
hphp/hack/src/typing/typing_subtype.ml
hphp/hack/src/typing/typing_suggest.ml
hphp/hack/src/typing/typing_taccess.ml
hphp/hack/src/typing/typing_unify.ml
hphp/hack/src/typing/typing_unify_recursive.ml
hphp/hack/src/typing/typing_utils.ml
hphp/hack/src/typing/typing_variance.ml