Populate class member caches for TypingDeclProvider
commit49cdebf8a0c1629930d0ed4aeb85ed961e0dc732
authorJake Bailey (Hacklang) <jakebailey@fb.com>
Wed, 9 Feb 2022 21:09:33 +0000 (9 13:09 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 9 Feb 2022 21:11:31 +0000 (9 13:11 -0800)
treecaf2feff003547aadd8cb723004c799ec245084a
parent1747cde239694c6d42213f1c9dff3da6214a411d
Populate class member caches for TypingDeclProvider

Summary: A typing `Class` (c.f. the `Eager` variant of `Typing_classes_heap.class_t`) contains a folded decl and a cache of class members. The purpose of the class-member-cache is to abstract over the fact that class elements in a folded decl don't contain their type (in hh_server, the type is stored on a separate heap, to reduce overfetching and duplication). When asked for a class member, the typing `Class` checks its member-cache. If not present, it looks up the type of the member using the FoldedDeclProvider, and populates its member-cache with a new `ClassElt` containing that type and any other metadata from the `FoldedElt`.

Reviewed By: shayne-fletcher

Differential Revision: D34061596

fbshipit-source-id: 2746b4bfca10d1398424b36104f78dcd137b6203
hphp/hack/src/rupro/lib/typing_decl_provider/defs.rs
hphp/hack/src/rupro/lib/typing_decl_provider/provider.rs
hphp/hack/src/rupro/lib/typing_defs/decl.rs