Skip to content

Restore resolving prefixes of implicit Ident#22751

Merged
sjrd merged 1 commit intoscala:mainfrom
som-snytt:issue/22744-private-given
Mar 10, 2025
Merged

Restore resolving prefixes of implicit Ident#22751
sjrd merged 1 commit intoscala:mainfrom
som-snytt:issue/22744-private-given

Conversation

@som-snytt
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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

5 participants