Skip to content
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

Fix #19732: quotes.reflect.Ref incorrectly casting This to RefTree #19930

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Mar 12, 2024

In the issue minimisation, tpd.ref returns a tpd.This(Ident(Inner$)) tree, where the inner ident is a type ident, which was unexpected. Trying to adjust the tpd.ref to return a RefType for that case seems dangerous, so I instead opted for a workaround directly inside the QuotesImpl.

At first I wanted to reuse the tpd.This tree somehow (or at least to use a correctly retyped Ident), but nothing I tried with it worked, so I ended up writing the correct Ref by hand.

Fixes #19732

@nicolasstucki nicolasstucki self-requested a review March 12, 2024 14:48
@nicolasstucki nicolasstucki merged commit a74470c into scala:main Mar 14, 2024
19 checks passed
@nicolasstucki nicolasstucki deleted the fix-i19732 branch March 14, 2024 09:03
@Kordyjan Kordyjan added this to the 3.4.2 milestone Mar 28, 2024
@lbialy
Copy link

lbialy commented Apr 2, 2024

will this be backported to 3.3.x LTS?

WojciechMazur added a commit that referenced this pull request Jul 4, 2024
…o `RefTree`" to LTS (#20990)

Backports #19930 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
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.

Referencing a tree of an inner class leads to a ClassCastException
4 participants