run Typing_check_decls.fun_ on lambdas, too
commit5f925ae40d959e541d4547addf5f025c180e8f1e
authorFrank Emrich <frankemrich@fb.com>
Tue, 11 Aug 2020 10:38:01 +0000 (11 03:38 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 11 Aug 2020 10:40:15 +0000 (11 03:40 -0700)
tree871ae163db749385e3c7e46c25d3058c53fc1a1f
parentb036027b35018be261afb943881fc5c74a64c575
run Typing_check_decls.fun_ on lambdas, too

Summary:
`Typing_check_decls` check types at definition sites, most notably if a type application `Foo<Bar>` satisfies the constraints on Foo's parameter. In the context of higher-kinded types, `Typing_check_decls` will also initiate a well-kindedness check on the involved types.

Currently, `Typing_check_decls` is not called on lambdas. This means that for instance the parameter types of a lambda may violate type constraints. The `violated_constraints.php` test I added is accepted without errors before my change.

Reviewed By: andrewjkennedy

Differential Revision: D22982346

fbshipit-source-id: 1ecbe39f880f2323a6a30a45a5e649a0f9bf747e
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/lambda/violated_constraints.php [new file with mode: 0644]
hphp/hack/test/typecheck/lambda/violated_constraints.php.exp [new file with mode: 0644]