-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 owner of splices in class statements #18359
Conversation
@@ -125,6 +125,18 @@ object PickledQuotes { | |||
val quotedType = evalHole.nn.apply(idx, reifyTypeHoleArgs(args)) | |||
PickledQuotes.quotedTypeToTree(quotedType) | |||
} | |||
case tree @ Template(constr, parents, self, _) if tree.derived.isEmpty => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can tree.derived not be empty here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied it from the TreeMap
case. Not sure why it is there. It was introduced in fb09e82.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up in #18368
case stat: DefTree => transform(stat) | ||
case stat => | ||
val localDummy = tree.tpe.termSymbol | ||
transform(stat)(using ctx.withOwner(localDummy)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could TreeMapWithPreciseStatContexts be reused to avoid a special case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
3c3cfe2
to
525e93c
Compare
Backports #18359 to the LTS branch. PR submitted by the release tooling. [skip ci]
Fixes #18358