New function get_class_or_typedefnightly-2020.11.16
commit31a94f6bed7117293034fd4622ec4fe3a1912c9a
authorAndrew Kennedy <akenn@fb.com>
Sun, 15 Nov 2020 15:21:11 +0000 (15 07:21 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sun, 15 Nov 2020 15:23:09 +0000 (15 07:23 -0800)
tree3e2d314887ad2a94bc1dc6a1061ae927465aa3d5
parent32b79dc734c5719f0fc8d1df2aacbff2ff0cc91d
New function get_class_or_typedef

Summary: There are a bunch of places where we switch on the "kind" of a type, and call `get_class` or `get_typedef` accordingly. It's cleaner to have a single function that returns a disjoint union; also, the dependency will be registered only once.

Reviewed By: jamesjwu

Differential Revision: D24917518

fbshipit-source-id: 935dc70e64d77e9d72600bca831fd046115075ed
13 files changed:
hphp/hack/src/typing/tast_check/instantiability_check.ml
hphp/hack/src/typing/tast_check/reified_check.ml
hphp/hack/src/typing/tast_env.ml
hphp/hack/src/typing/tast_env.mli
hphp/hack/src/typing/type_validator.ml
hphp/hack/src/typing/typing_check_decls.ml
hphp/hack/src/typing/typing_enforceability.ml
hphp/hack/src/typing/typing_env.ml
hphp/hack/src/typing/typing_env.mli
hphp/hack/src/typing/typing_kinding.ml
hphp/hack/src/typing/typing_phase.ml
hphp/hack/src/typing/typing_variance.ml
hphp/hack/test/unit/server_tests.ml