Skip to content

pyrefly coverage computes incomplete_attributes but never outputs it #4023

Description

@jorenham

No reproducer, because nothing is user-visible (that's kinda the point).

On every run, parse_classes fills ReportClass.incomplete_attributes by walking each class's MRO, with cross-module get_class_fields lookups and an annotation check of every method. build_module_report then drops all of it. The only thing a class contributes to the report is

{"kind": "class", "name": "Child", "n_typable": 0, "n_typed": 0, "n_any": 0, "n_untyped": 0, "location": {"line": 4, "column": 1}}

and no pyrefly coverage check error reads it either. So the whole MRO analysis unnecessarily bloats memory (partially contributing to #3989, not sure by how much though).

Deleting it looks better than serializing it, because the data is, well, plain wrong. The inherited-field check uses ClassFieldProperties::is_annotated (hardcoded as false for MethodLike fields) so every inherited method is recorded as incomplete no matter how fully it is annotated.

Metadata

Metadata

Assignees

Labels

coverageIssues related to `pyrefly coverage`, `pyrefly report`quansight

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions