Move type arity checks to type_params_arity_check (1/2)
commitdce76e93d95b120e8c73bf6fb045fb30106fc386
authorMaggie Moss <maggiemoss@fb.com>
Tue, 5 Feb 2019 20:23:39 +0000 (5 12:23 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 5 Feb 2019 20:37:50 +0000 (5 12:37 -0800)
treea6dbbc9676b1ba67b7d813a3c3618a5da627d713
parent1cf237f593803876268bf382b06110a9f90755e0
Move type arity checks to type_params_arity_check (1/2)

Summary:
Type arity is checked in several places across HackC, this pulls it out of `nastCheck` and `typing_unify` into it's own tast check.

As well, the checks done in `nastCheck` were relying on the `tenv`.

Reviewed By: kmeht

Differential Revision: D13911733

fbshipit-source-id: 39e6b8c5745a4e7eb22cc422986374bcfe39dcaa
20 files changed:
hphp/hack/src/typing/nastCheck.ml
hphp/hack/src/typing/tast_check/tast_check.ml
hphp/hack/src/typing/tast_check/type_params_arity_check.ml [new file with mode: 0644]
hphp/hack/src/typing/tast_visitor.ml
hphp/hack/src/typing/typing_unify.ml
hphp/hack/test/typecheck/as_expression/class2.php.exp
hphp/hack/test/typecheck/as_expression/class3.php.exp
hphp/hack/test/typecheck/as_expression/dict.php.exp
hphp/hack/test/typecheck/as_expression/dict2.php.exp
hphp/hack/test/typecheck/as_expression/keyset.php.exp
hphp/hack/test/typecheck/as_expression/keyset2.php.exp
hphp/hack/test/typecheck/as_expression/vec.php.exp
hphp/hack/test/typecheck/as_expression/vec2.php.exp
hphp/hack/test/typecheck/incorrect_tparam_arity.php
hphp/hack/test/typecheck/incorrect_tparam_arity.php.exp
hphp/hack/test/typecheck/is_expression/dict.php.exp
hphp/hack/test/typecheck/is_expression/keyset.php.exp
hphp/hack/test/typecheck/is_expression/vec.php.exp
hphp/hack/test/typecheck/pair-literal-3.php.exp
hphp/hack/test/typecheck/typedefs_generics_arity3.php.exp