Make ExprTree's TInfer type param covariant
commit159c8e21c420bba08302752c0aa60b6435fbe641
authorThomas Jiang <thomasjiang@fb.com>
Mon, 21 Dec 2020 22:42:02 +0000 (21 14:42 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 21 Dec 2020 22:46:08 +0000 (21 14:46 -0800)
tree94c06c62b3c83e70582182113048dbc7c5510e94
parent30e428abd0e32fb566027c86e8eb5390ba1d9ad2
Make ExprTree's TInfer type param covariant

Summary:
ExprTree can be covariant in the third type parameter

That way we can say that

`ExprTree<_, _, Subclass>` is a subtype of `ExprTree<_, _, Superclass>`. Which I believe is correct.

Reviewed By: Wilfred

Differential Revision: D25406677

fbshipit-source-id: f33ad3249281149be22f3046550e2a25122f44b7
64 files changed:
hphp/hack/test/typecheck/expression_trees/arithmetic.php
hphp/hack/test/typecheck/expression_trees/assign.php
hphp/hack/test/typecheck/expression_trees/boolean_and.php
hphp/hack/test/typecheck/expression_trees/boolean_check.php
hphp/hack/test/typecheck/expression_trees/boolean_operators.php
hphp/hack/test/typecheck/expression_trees/boolean_or.php
hphp/hack/test/typecheck/expression_trees/bound_variable_lambda.php
hphp/hack/test/typecheck/expression_trees/break.php
hphp/hack/test/typecheck/expression_trees/call.php
hphp/hack/test/typecheck/expression_trees/comparison_operators.php
hphp/hack/test/typecheck/expression_trees/consecutive_splicing.php
hphp/hack/test/typecheck/expression_trees/continue.php
hphp/hack/test/typecheck/expression_trees/elvis.php
hphp/hack/test/typecheck/expression_trees/expr_tree_defs.php
hphp/hack/test/typecheck/expression_trees/float.php
hphp/hack/test/typecheck/expression_trees/fully_qualified.php [copied from hphp/hack/test/typecheck/expression_trees/float.php with 98% similarity]
hphp/hack/test/typecheck/expression_trees/hover_type.php
hphp/hack/test/typecheck/expression_trees/if.php
hphp/hack/test/typecheck/expression_trees/infinite_loop.php
hphp/hack/test/typecheck/expression_trees/instance_method_call.php
hphp/hack/test/typecheck/expression_trees/invalid_call1.php
hphp/hack/test/typecheck/expression_trees/invalid_call1.php.exp
hphp/hack/test/typecheck/expression_trees/invalid_call2.php
hphp/hack/test/typecheck/expression_trees/invalid_call2.php.exp
hphp/hack/test/typecheck/expression_trees/invalid_call3.php
hphp/hack/test/typecheck/expression_trees/invalid_operator.php
hphp/hack/test/typecheck/expression_trees/lambda.php
hphp/hack/test/typecheck/expression_trees/lambda_call.php
hphp/hack/test/typecheck/expression_trees/loop.php
hphp/hack/test/typecheck/expression_trees/mismatched_types.php
hphp/hack/test/typecheck/expression_trees/namespace.php
hphp/hack/test/typecheck/expression_trees/nested_expression_trees.php
hphp/hack/test/typecheck/expression_trees/nested_splicing.php
hphp/hack/test/typecheck/expression_trees/nested_splicing2.php
hphp/hack/test/typecheck/expression_trees/not.php
hphp/hack/test/typecheck/expression_trees/null.php
hphp/hack/test/typecheck/expression_trees/parent_static_method_call.php
hphp/hack/test/typecheck/expression_trees/parse_constants.php
hphp/hack/test/typecheck/expression_trees/self_static_method_call.php
hphp/hack/test/typecheck/expression_trees/splice.php
hphp/hack/test/typecheck/expression_trees/splice2.php
hphp/hack/test/typecheck/expression_trees/splice_call.php
hphp/hack/test/typecheck/expression_trees/splice_err1.php
hphp/hack/test/typecheck/expression_trees/splice_err2.php
hphp/hack/test/typecheck/expression_trees/splice_err3.php
hphp/hack/test/typecheck/expression_trees/splice_err4.php
hphp/hack/test/typecheck/expression_trees/splice_infer.php
hphp/hack/test/typecheck/expression_trees/splice_state.php
hphp/hack/test/typecheck/expression_trees/splice_state2.php
hphp/hack/test/typecheck/expression_trees/splice_state3.php
hphp/hack/test/typecheck/expression_trees/splice_state4.php
hphp/hack/test/typecheck/expression_trees/splice_variable.php
hphp/hack/test/typecheck/expression_trees/splice_variable2.php
hphp/hack/test/typecheck/expression_trees/splice_variable3.php
hphp/hack/test/typecheck/expression_trees/splice_variable4.php
hphp/hack/test/typecheck/expression_trees/splice_variable_state.php
hphp/hack/test/typecheck/expression_trees/static_method_call.php
hphp/hack/test/typecheck/expression_trees/static_static_method_call.php
hphp/hack/test/typecheck/expression_trees/subtype.php [copied from hphp/hack/test/typecheck/expression_trees/loop.php with 87% similarity]
hphp/hack/test/typecheck/expression_trees/subtype.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/expression_trees/subtype.php.like_types.exp [new file with mode: 0644]
hphp/hack/test/typecheck/expression_trees/ternary.php
hphp/hack/test/typecheck/expression_trees/unbound_variables.php
hphp/hack/test/typecheck/expression_trees/variable_call.php