Use dynamic-aware subtyping for constraint checks on explicit type arguments
commit259f878e31a3f225dedc60333cf088e8853f579d
authorAndrew Kennedy <akenn@fb.com>
Wed, 24 Mar 2021 13:22:37 +0000 (24 06:22 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 30 Mar 2021 19:52:48 +0000 (30 12:52 -0700)
tree23ae0533cc3fdad22bcd83f510ba0eb2fd0ecaf3
parent7ec0f5221312cab4f6dc34da589a178796bc8226
Use dynamic-aware subtyping for constraint checks on explicit type arguments

Summary: Currently we don't check generic parameter constraints wrt the larger "dynamic-aware" subtyping. We should: then we can write `class C<T as dynamic>` and permit `new C<string>(...)`, for example.

Reviewed By: vsiles

Differential Revision: D27289899

fbshipit-source-id: c8ece4df9b0b1d5651283908213ed25ec2355610
hphp/hack/src/typing/typing_generic_constraint.ml
hphp/hack/test/sound_dynamic/typing/generic_constraint_dynamic.bad.php [new file with mode: 0644]
hphp/hack/test/sound_dynamic/typing/generic_constraint_dynamic.bad.php.exp [new file with mode: 0644]
hphp/hack/test/sound_dynamic/typing/generic_constraint_dynamic.php [new file with mode: 0644]
hphp/hack/test/sound_dynamic/typing/generic_constraint_dynamic.php.exp [new file with mode: 0644]