Remove redundant check for constraint satisfaction on extends and implements
commitba6a6cb57eabd7135e5aeb169c306d53b454dc44
authorAndrew Kennedy <akenn@fb.com>
Mon, 1 Jun 2020 17:11:18 +0000 (1 10:11 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 1 Jun 2020 17:17:22 +0000 (1 10:17 -0700)
treeec862bcb9ee518110bc428c02742f0253ba994ad
parent7bf0521c669db49e43c8e9ff3e1b83f97189450c
Remove redundant check for constraint satisfaction on extends and implements

Summary:
As it says in the title. Localization of `extends` and `implements` types already checks that they are correct wrt constraints on type parmaeters e.g. if we have `C<T as I> extends D<t>` and `D` has a constraint on its type parameter, then `t` will be checked against `I` under the assumption that `T <: I`. This is done in `NastCheck.class_`, and does not need to be repeated in `Typing_toplevel.class_def`.

This diff therefore removes a bunch of redundant errors.

Reviewed By: CatherineGasnier

Differential Revision: D21762661

fbshipit-source-id: 3f4c2ca0dd04bc552083dc6399589cca53db92f5
hphp/hack/src/typing/typing_toplevel.ml
hphp/hack/test/typecheck/constraints/constraint_bad_usepos.php.exp
hphp/hack/test/typecheck/constraints/extend_generic2.php.exp
hphp/hack/test/typecheck/constraints/gen5.php.exp
hphp/hack/test/typecheck/constraints/gen7.php.exp
hphp/hack/test/typecheck/constraints/type_constant_nast.php.exp