Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Jan 16, 2026

If some member from a root import is hidden by a subsequent import, don't suggest that member in a "did you mean?" clause.

Fixes #24995

If some member from a root import is hidden by a subsequent import, don't
suggest that member in a "did you mean?" clause.
@odersky odersky requested a review from SolalPirelli January 16, 2026 16:56
@odersky odersky added the better-errors Issues concerned with improving confusing/unhelpful diagnostic messages label Jan 16, 2026
Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

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

Otherwise, nice tweak && nice opportunity to glance at DidYouMean.

Copy link
Contributor

@SolalPirelli SolalPirelli left a comment

Choose a reason for hiding this comment

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

Looks good. Just so I understand this better, is there a fundamental reason why DidYouMean has to partially reimplement the logic for finding things?

@odersky
Copy link
Contributor Author

odersky commented Jan 16, 2026

Looks good. Just so I understand this better, is there a fundamental reason why DidYouMean has to partially reimplement the logic for finding things?

I think it's because in Typer we search for one name only, and do so in a highly optimized way. Whereas in DidyouMean we search for all members and then match them with the Levenshtein distance.

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

Labels

better-errors Issues concerned with improving confusing/unhelpful diagnostic messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect "did you mean" in the presence of shadowed root imports

3 participants