Skip to content

Dedupe symbol count fields in pyrefly coverage#3771

Open
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:coverage/dedupe-symbol-counts
Open

Dedupe symbol count fields in pyrefly coverage#3771
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:coverage/dedupe-symbol-counts

Conversation

@jorenham

Copy link
Copy Markdown
Contributor

Summary

The ModuleReport and ReportSummary structs both had the same 8 n_{symbol} count fields, which were modified in collect.rs one by one in three functions. So if you wanted to add a new symbol counter, you'd have to do so in 5 places.

This dedupes these fields using he same #[serde(flatten)] trick used for the "slot" (typable) counts.

This is purely a refactor; so there are no behavior changes.

This shouldn't cause any merge conflicts with #3747.

Test Plan

Tests still pass.

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants