Embed Provider_context.t in Typing_classes_heap.t
commite24b253f4d786f9418e25de8554e1546627951f7
authorHenri Verroken <hverr@fb.com>
Thu, 3 Feb 2022 10:41:59 +0000 (3 02:41 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 3 Feb 2022 10:43:39 +0000 (3 02:43 -0800)
tree85ad843c9de2c786e833c0b833df48cd56565ed7
parentb2fc3b6127cf77aff1b09805dee786d765b59c95
Embed Provider_context.t in Typing_classes_heap.t

Summary:
When calling the `Cls.{construct,method,smethod,prop,sprop}` accessors on `Typing_classes_heap.t` we will need a `Provider_context.t` if we want to access the shallow decl in the event that the member signature was evicted from the member heaps/worker cache.

There are two ways to do this:

  1. The approach this diff takes: embed a `Provider_context.t` in each `Typing_class_heap.t`
  2. Have all `Cls.{construct,method,...}` take an additional `ctx` argument and fixup all callsites.

Unfortunately, (2) is not cleanly feasible. Zoncolan abstracts over Hack's decl provider and none of the callsites have access to a `Provider_context.t`. Refactoring this would be hellish.

For now the embedded `ctx` is not yet used. See next diffs

Reviewed By: CatherineGasnier

Differential Revision: D33897157

fbshipit-source-id: d89e515e3f08a26203300e02cce0c7a6ce15c8b0
hphp/hack/src/providers/decl_provider.ml
hphp/hack/src/typing/typing_classes_heap.ml
hphp/hack/src/typing/typing_classes_heap.mli