Print like types
commit61478b281ab1434f69e902831f7878adbac9afa1
authorVassil Mladenov <vmladenov@fb.com>
Thu, 16 May 2019 02:56:41 +0000 (15 19:56 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 16 May 2019 03:00:35 +0000 (15 20:00 -0700)
tree3d951ff388c62fa25cd364e382fa9a6799d8b54e
parentef5018349d2790e69eb474006464166aaeb3826a
Print like types

Summary: This adds printing of like types for the locl ty case (union with dynamic), while the decl ty case is handled by `Tlike`. Following the existing implementation of complex unions with null, I went with `~` in front instead of union with `dynamic`, i.e. `(dynamic | null | int | string)` prints as `~?(int | string)` instead of `?(dynamic | int | string)`.

Reviewed By: dlreeves

Differential Revision: D15349710

fbshipit-source-id: 8ddef46e58c16b4a4ae8fc69a29f1fdaf18f8ba9
hphp/hack/src/typing/typing_print.ml
hphp/hack/test/typecheck/like_types/hints.php.exp
hphp/hack/test/typecheck/like_types/hints.php.legacy.exp
hphp/hack/test/typecheck/like_types/print_big_union.php [new file with mode: 0644]
hphp/hack/test/typecheck/like_types/print_big_union.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/like_types/print_big_union.php.legacy.exp [new file with mode: 0644]
hphp/hack/test/typecheck/like_types/print_like_type.php [new file with mode: 0644]
hphp/hack/test/typecheck/like_types/print_like_type.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/like_types/print_like_type.php.legacy.exp [new file with mode: 0644]