Skip to content

Add missing owner for ValDef.let #10402

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

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Nov 20, 2020

Alternative fix of the missing owner of ValDef.let with explicit owners. Alternative with contextual owners in #10394.

@nicolasstucki nicolasstucki self-assigned this Nov 20, 2020
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

It is a bit verbose than the previous API. However, I think it is better to be safer than the easiness which could be error-inviting.

@@ -2673,6 +2674,9 @@ trait QuoteContext { self: internal.QuoteUnpickler & internal.QuoteMatching =>

trait SymbolModule { this: Symbol.type =>

/** Owner definition of the current splice */
def spliceOwner: Symbol

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: what about currentOwner? I find spliceOwner is not so easy to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current owner will eventually need to disappear if we use an explicit owner scheme. spliceOwner is the ower of the current splice (i.e. x in val x = ${ ... }; ...). This is the same as the owner of the current QuoteContext. But currentOwner would be a confusing name to use for this one as in the middle of a TreeMap the current owner is not the same as the owner of the QuoteContext.

@nicolasstucki nicolasstucki force-pushed the add-missing-owner-to-ValDef.let branch from 92929be to dc03cb6 Compare November 20, 2020 10:48
@nicolasstucki nicolasstucki marked this pull request as ready for review November 20, 2020 11:17
@nicolasstucki nicolasstucki merged commit 1719ec6 into scala:master Nov 20, 2020
@nicolasstucki nicolasstucki deleted the add-missing-owner-to-ValDef.let branch November 20, 2020 12:25
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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.

3 participants