Allow comparisons with like types
commita316bda63aa900b526b6e23146bb4488894bd431
authorVassil Mladenov <vmladenov@fb.com>
Fri, 4 Oct 2019 22:33:10 +0000 (4 15:33 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 4 Oct 2019 22:37:06 +0000 (4 15:37 -0700)
tree4301fbc66bdad9cc52a3857a8dd7d856cf5182ff
parent3e5d9fa6c453817017622b7cca2c6626eba666cd
Allow comparisons with like types

Summary: The comparison test was checking whether both elements were a subtype of num or both were a subtype of dynamic. This relaxes the restriction to test against `~num`, `~string`, or `~(DateTime|DateTimeImmutable)`.

Reviewed By: dlreeves

Differential Revision: D17766096

fbshipit-source-id: 85f267f2d0598b1a969d974aec616d6c6375b09f
24 files changed:
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/arithmetic_any.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/array_map.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/constraints/recursive_constraint_good.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/datetime_compare.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/datetimeimmutable_compare.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/idx2_1.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/idx_too_few_args.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/idx_too_many_args.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/key_exists_refines_union_bad.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/lambda/curried.php
hphp/hack/test/typecheck/lambda/lambda_reduce.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/lambda/sort_by.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/like_types/dynamic_coercion/like_not_subtype.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/like_types/dynamic_coercion/t_as_like.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/like_types/dynamic_coercion/vecs.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/like_types/pessimization/erased_generic_bounded_above.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/new_inference/array_filter_then_invoke.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/new_inference/eager_solve/nullable_predicate_lambda.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/new_inference/recursive_constraint_good.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/newtype8.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/union/null_inter_nonnull.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/using/extend_non_disposable_interface_bad.php.like_types.exp [deleted file]
hphp/hack/test/typecheck/using/extend_non_disposable_interface_good.php.like_types.exp [deleted file]