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

bugfix: emit as extension method if member of implicit class with val in constructor #6190

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

kasiaMarek
Copy link
Contributor

connected to: #6156 (comment)

indent,
isAfterNewline = false,
currRegion,
if (isInParen) expectTemplate else newExpectIgnoreBody
Copy link
Member

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

@kasiaMarek kasiaMarek Mar 5, 2024

Choose a reason for hiding this comment

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

implicit class A(val v: Int) {

}

So when we are on class we'll add something like expect implicit class body, and then in parenthesis we'll emit val v but we want to keep the information about the "expect implicit class body", since it will be needed to construct correct region on {.

I wanted to write that this is safe, since there are no { } inside the constructor definition, but I'm second guessing this because of RefinedTypes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed for refined types.

Copy link
Member

@jkciesluk jkciesluk left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 711 to 712
// additionalSymbolCheck(doc.symbols)
// val symbols = doc.symbols.map(_.symbol).toList
Copy link
Member

Choose a reason for hiding this comment

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

Leftover?

@kasiaMarek kasiaMarek merged commit b2b0ac5 into scalameta:main Mar 11, 2024
21 of 26 checks passed
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.

2 participants