Allow effect-polymorphic supportdyn closures
commitac3f59f869fdc6bf3c20d6c1a360a63ac432195f
authorVassil Mladenov <vmladenov@fb.com>
Wed, 12 Jan 2022 19:44:28 +0000 (12 11:44 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 12 Jan 2022 19:46:15 +0000 (12 11:46 -0800)
tree5344f13ea5f2571c909690a65b322386ba5f27da
parentdf958b376440e1c4b92e4df1ee951b367ee7bd5f
Allow effect-polymorphic supportdyn closures

Summary:
Effect-polymorphic higher-order functions have tight restrictions on the type of the closure parameter, requiring `(function (t1, ..., tn)[_]: tr)`. Optional types are allowed. D31291664 (https://github.com/facebook/hhvm/commit/d71c612b356f60bb2e7876d377a82cc19b781af4) allowed like types.

We want to pessimise closure types into `supportdyn<(function ...)>`. This allows unwrapping of `supportdyn` in the pass that traverses `?` and `~`.

Reviewed By: andrewjkennedy

Differential Revision: D33304736

fbshipit-source-id: 97509adef8ababcd5e38b9530bdc456855877528
hphp/hack/src/decl/direct_decl_smart_constructors.rs
hphp/hack/src/naming/naming_special_names.rs
hphp/hack/src/parser/lowerer/lowerer.rs
hphp/hack/test/sound_dynamic/typing/supportdyn_effect_polyomrphic.good.php [new file with mode: 0644]
hphp/hack/test/sound_dynamic/typing/supportdyn_effect_polyomrphic.good.php.exp [new file with mode: 0644]