Do not use tc_need_init and tc_deferred_init_members when shallow_class_decl is enabled
commit595babea320c6fe7e8116cc587b3816c63da3961
authorJake Bailey (Hacklang) <jakebailey@fb.com>
Wed, 17 Apr 2019 19:25:00 +0000 (17 12:25 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 17 Apr 2019 19:32:39 +0000 (17 12:32 -0700)
tree99fe63e9ae451ee50a0512bb81017703f74a3d46
parent402e7767b4eefd7b1187d5074839348bbb857c9a
Do not use tc_need_init and tc_deferred_init_members when shallow_class_decl is enabled

Summary: Now that `Typing_classes_heap.lazy_class_type` provides lazy lookup of class constructors from shallow declarations, it is possible to determine whether a class has members which need initialization without using the folded `class_type`. This diff removes reads of `tc_need_init` and `tc_deferred_init_members`, bits of derived information about the class constructor, when shallow_class_decl is enabled. The module deriving the set of deferred init members, Decl_init_check, is duplicated (and slightly modified) as Typing_deferred_members, since it is now invoked per-file by Typing (via NastInitCheck) rather than done ahead of time during eager decl.

Reviewed By: arxanas

Differential Revision: D13571855

fbshipit-source-id: edfbcbd65b48b174f7376538a919b332e4dd3137
13 files changed:
hphp/hack/src/decl/decl.ml
hphp/hack/src/decl/decl_env.ml
hphp/hack/src/decl/shallow_decl.ml
hphp/hack/src/typing/dune
hphp/hack/src/typing/nastInitCheck.ml
hphp/hack/src/typing/typing_classes_heap.ml
hphp/hack/src/typing/typing_classes_heap.mli
hphp/hack/src/typing/typing_deferred_members.ml [new file with mode: 0644]
hphp/hack/src/typing/typing_env.ml
hphp/hack/src/typing/typing_env.mli
hphp/hack/src/typing/typing_extends.ml
hphp/hack/src/typing/typing_print.ml
hphp/hack/test/typecheck/override_final2.php