Skip to content

fix duplicate names in pyrefly report #3097#3130

Closed
jorenham wants to merge 1 commit intofacebook:mainfrom
jorenham:gh-3097
Closed

fix duplicate names in pyrefly report #3097#3130
jorenham wants to merge 1 commit intofacebook:mainfrom
jorenham:gh-3097

Conversation

@jorenham
Copy link
Copy Markdown
Contributor

@jorenham jorenham commented Apr 14, 2026

Summary

This dedupes names of overloaded functions and properties with multiple accessors.

Fixes #3097

Test Plan

Deduped names in tests

@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. ✅

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 15, 2026

@rchen152 has imported this pull request. If you are a Meta employee, you can view this in D100901014.

Copy link
Copy Markdown
Contributor

@stroxler stroxler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 15, 2026

@rchen152 merged this pull request in 7c41594.

@jorenham jorenham deleted the gh-3097 branch April 15, 2026 17:39
Copy link
Copy Markdown
Contributor

@connernilsen connernilsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this, some very minor requests

}

// Overloads and property accessors produce duplicate names.
let mut seen = HashSet::new();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a SmallSet here?

Comment on lines +1383 to +1384
let mut seen = HashSet::new();
names.retain(|n| seen.insert(n.clone()));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor question, but why not use a SmallSet for names and convert to a vec here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know that was a thing tbh. You want me to open a PR for that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a minor thing, feel free to do it if you want, but since this PR is already closed, you don't have to

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta-codesync Bot pushed a commit that referenced this pull request Apr 22, 2026
Summary:
As suggested by connernilsen in #3130 (comment)

Pull Request resolved: #3196

Test Plan: Non-functional change; existing tests still pass

Reviewed By: connernilsen

Differential Revision: D101882136

Pulled By: migeed-z

fbshipit-source-id: ec77b85b83d56acd0f3780ad96d7bb81bfddb798
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.

pyrefly report: names of overloaded functions are listed multiple times

3 participants