@@ -3484,21 +3484,14 @@ def finish_passes(self) -> None:
34843484 if options .export_types :
34853485 manager .all_types .update (self .type_map ())
34863486
3487- # Indirect dependencies: modules this one never imports directly but
3488- # whose interface changes must still invalidate it. Three sources:
3489- # * module_refs: modules reached via attribute access or re-exports
3490- # (mostly recorded during semantic analysis).
3491- # * The type of every checked expression, resolved to the modules
3492- # defining the type's components — for a class instance, its whole
3493- # MRO (TypeIndirectionVisitor, inside patch_indirect_dependencies).
3494- # * For mypyc-compiled modules: the ancestors of every class
3495- # *defined* here. Generated C embeds each ancestor's method and
3496- # attribute layout (vtables, object struct), so the defining module
3497- # must be recompiled when any ancestor's interface changes. A bare
3498- # `class B(A): pass` produces no expression types, so the
3499- # sources above record nothing for it, and staleness propagation
3500- # would stop at intermediate modules whose own interfaces are
3501- # unchanged.
3487+ # Possible sources of indirect dependencies:
3488+ # * Symbols not directly imported in this module but accessed via an attribute
3489+ # or via a re-export (vast majority of these recorded in semantic analysis).
3490+ # * For each expression type we need to record definitions of type components
3491+ # since "meaning" of the type may be updated when definitions are updated.
3492+ # * For mypyc-compiled modules only: modules defining MRO ancestors of
3493+ # classes defined here, since the generated C embeds each ancestor's
3494+ # method/attribute layout.
35023495 indirect_refs = self .tree .module_refs | self .type_checker ().module_refs
35033496 if self .options .mypyc :
35043497 indirect_refs |= self .compiled_class_ancestor_refs ()
0 commit comments