Allow reactivity of the function to be determined from the reactivity of lambda arguments
commit210ab4abd55bf7bc5b52290d2f3e5022f072247d
authorVladimir Matveev <vladima@fb.com>
Tue, 14 Aug 2018 04:03:59 +0000 (13 21:03 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 14 Aug 2018 04:32:05 +0000 (13 21:32 -0700)
treed36a29f90ab35b9bc1a2faecb5708cc95d9c5eab
parent8b918033f703eff8d3bb5842802498ec536d669b
Allow reactivity of the function to be determined from the reactivity of lambda arguments

Summary:
As in title.
Prior to this diff we used to interpret `__OnlyRxIfRxFunc` as a condition that must be satisfied at the call site in order for function call to be treated as reactive. With this diff interpretation is different: if function has parameter  annotated with `__AtMostRxAsRxFunc` attribute - this means that effective reactivity of the function at its callsite will be determined by taking common upper bound of declared function reactivity and reactivity of arguments that correspond to parameters annotated with `__AtMostRxAsRxFunc`.

Reviewed By: jamesjwu

Differential Revision: D9239324

fbshipit-source-id: 2c548a92e60a581a14b0013888d6538fb7221355
50 files changed:
hphp/hack/src/decl/decl.ml
hphp/hack/src/decl/decl_hint.ml
hphp/hack/src/decl/decl_pos_utils.ml
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors_sig.ml
hphp/hack/src/typing/pp_type.ml
hphp/hack/src/typing/tast_expand.ml
hphp/hack/src/typing/typing.ml
hphp/hack/src/typing/typing_defs.ml
hphp/hack/src/typing/typing_reactivity.ml
hphp/hack/src/typing/typing_subtype.ml
hphp/hack/src/typing/typing_utils.ml
hphp/hack/test/typecheck/mayberx11.php.exp
hphp/hack/test/typecheck/print_in_rx9.php.exp
hphp/hack/test/typecheck/reactive/at_most_rx_as_func1.php [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/at_most_rx_as_func1.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/at_most_rx_as_func2.php [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/at_most_rx_as_func2.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/at_most_rx_as_func3.php [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/at_most_rx_as_func3.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/at_most_rx_as_func4.php [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/at_most_rx_as_func4.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/cond_reactive_ret_type2.php.exp
hphp/hack/test/typecheck/reactive/cond_reactive_ret_type3.php.exp
hphp/hack/test/typecheck/reactive/conditional_reactivity1.php [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/conditional_reactivity1.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/conditional_reactivity2.php [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/conditional_reactivity2.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/mayberx12.php
hphp/hack/test/typecheck/reactive/mayberx12.php.exp
hphp/hack/test/typecheck/reactive/mayberx15.php.exp
hphp/hack/test/typecheck/reactive/mayberx7_1.php.exp
hphp/hack/test/typecheck/reactive/mayberx7_2.php.exp
hphp/hack/test/typecheck/reactive/mayberx8.php.exp
hphp/hack/test/typecheck/reactive/mayberx9.php.exp
hphp/hack/test/typecheck/reactive/nonrx_parent_call.php.exp
hphp/hack/test/typecheck/reactive/nullable_condition_type1.php [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/nullable_condition_type1.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/reactive/nullable_mayberx2.php.exp
hphp/hack/test/typecheck/reactive/reactive_calls1.php.exp
hphp/hack/test/typecheck/reactive/rx_if_implements14.php.exp
hphp/hack/test/typecheck/reactive/rx_if_implements26.php.exp
hphp/hack/test/typecheck/reactive/rx_if_implements3.php.exp
hphp/hack/test/typecheck/reactive/rx_if_implements33.php.exp
hphp/hack/test/typecheck/reactive/rx_of_scope12.php.exp
hphp/hack/test/typecheck/reactive/test_local_reactive2.php.exp
hphp/hack/test/typecheck/reactive/test_rx_enabled3.php.exp
hphp/hack/test/typecheck/reactive/test_rxshallow2.php.exp
hphp/hack/test/typecheck/rx_if_implements13.php.exp
hphp/hack/test/typecheck/test_lambda2.php.exp