Refactor property elements to return a list
commit8a91199cd1914bbf95a1ea68547c31a37f16f5dc
authorJames Wu <jjwu@fb.com>
Fri, 12 Mar 2021 21:04:32 +0000 (12 13:04 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 12 Mar 2021 21:06:58 +0000 (12 13:06 -0800)
treeca0d4dfff7c6de9513ee70a76230596d8ab3c96d
parenta4faaa60166ab739f00af5aec9c5095ae9ff18ff
Refactor property elements to return a list

Summary:
This refactoring prepares to handle union and generic types for property accesses.

When you do a static property or regular property access on a union type, we'll need to return the list of all class elements it could be returning. This diff refactors the get_prop_elt code to get a list of elements instead of a single one.

Afterwards, in the diff above, we'll use the list to implement union type obj and class gets.

Reviewed By: zilberstein

Differential Revision: D26660944

fbshipit-source-id: b625abac0c225f5054f4c09213e8755a03da60a7
hphp/hack/src/typing/tast_check/readonly_check.ml