Add pure context to `extract_standalone_make_default` generated function
commitdf8b38ce6182426cff5b97066bb1ba850dbbd256
authorMichael Thomas <mjt@fb.com>
Fri, 19 Feb 2021 10:23:37 +0000 (19 02:23 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 19 Feb 2021 10:27:58 +0000 (19 02:27 -0800)
tree1ea9161f897536ea793565da41786b9c269d5d30
parent404dfe838bb8733c2c2f597ad225b9c1f9e866ec
Add pure context to `extract_standalone_make_default` generated function

Summary: `hh --extract-standalone` generates a function `extract_standalone_make_default` whenever at least one extracted function parameter has a default value. Although the function is _annotated_ as pure, with `<<__Pure>>`, the type checker will complain when it is called from a pure function as it does not have an explicit pure context (i.e. an empty intersection of contexts). This diff updates the function with an empty contexts and modifies related tests.

Reviewed By: madgen

Differential Revision: D26512234

fbshipit-source-id: b155b1f3de3f64c6b6dd15dcb97df0929a06799e
hphp/hack/src/server/serverExtractStandalone.ml
hphp/hack/test/integration/data/dependencies/expected/__WithOptionalConstructorArguments++get.php.exp
hphp/hack/test/integration/data/dependencies/expected/__call_defaulted.php.exp
hphp/hack/test/integration/data/dependencies/expected/__call_reactive.php.exp
hphp/hack/test/integration/data/dependencies/expected/__call_with_default_and_anonymous_variadic.php.exp
hphp/hack/test/integration/data/dependencies/expected/__call_with_default_and_variadic.php.exp
hphp/hack/test/integration/data/dependencies/expected/__with_mapped_namespace.php.exp