Skip to content

Restore resolving prefixes of implicit Ident #22751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Mar 8, 2025

Fixes #22744

This code was originally for derived, but is also needed for implicits (where private objects are in the path).

#17095

@som-snytt
Copy link
Contributor Author

During the "refactor" (there was refactoring before it was squashed into a rewrite, aka a refactor with behavior changes), I tried to preserve institutional knowledge. I still refer to history in considering new tickets. I miss having history of my own, although I've preserved the unsquashed branch somewhere. (I used to refer to "the August code", "the October code", "the November code".)

I had either missed or forgotten the classic: Refactor unused imports to try and make sense of it.

@som-snytt som-snytt force-pushed the issue/22744-private-given branch from a8bf3a4 to ba39f3e Compare March 8, 2025 18:38
@som-snytt som-snytt marked this pull request as ready for review March 8, 2025 18:39
@som-snytt
Copy link
Contributor Author

som-snytt commented Mar 8, 2025

It induces spurious warnings by virtue of aliasing at different position?

-- [E198] Unused Symbol Warning: tests/warn/unused-privates.scala:98:2 ---------
98 |  private object Dongo { def f = this } // warn
   |  ^
   |  unused private member
-- [E198] Unused Symbol Warning: tests/warn/unused-privates.scala:98:17 --------
98 |  private object Dongo { def f = this } // warn
   |                 ^^^^^
   |                 unused private member

Edit: that was due to desugaring to "module val" and "module class".

@som-snytt som-snytt force-pushed the issue/22744-private-given branch from ba39f3e to d1852bf Compare March 8, 2025 20:40
@Gedochao Gedochao requested a review from sjrd March 10, 2025 09:00
@sjrd sjrd merged commit a59d3e1 into scala:main Mar 10, 2025
29 checks passed
@som-snytt som-snytt deleted the issue/22744-private-given branch March 10, 2025 14:34
@WojciechMazur WojciechMazur added this to the 3.7.0 milestone Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive unused private object in 3.7 nightly when givens in object are used
3 participants