-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Extra check to avoid converting block expressions on the rhs of an in… #20043
Conversation
Does the fixes link need to be in the OP comment? I don't see the ticket saying may be fixed by. |
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.
Thank you for your collaboration to Scala 3. The main issue of this ticket is that at the moment, we rewrite when we have braces after a symbolic operator. The syntax doesn't allow us to have an indented block in this case. For this PR, I would expect at least the following test to work:
- No rewrite:
Reactions += {
partialFunction
}
- Should rewrite (because the operator is not symbolic):
infix def run(f: PartialFunction[Int, Unit]) = ???
Reactions run {
case 0 => ???
}
Oh! |
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.
LGTM
@LucySMartin Can you squash your commits before I merge it ? Thanks |
…bolic infix expression. Tests added for: * Original cast as per the ticket should not be changed * Similar match statement that should update * Code blocks in this position, as opposed to a partial function, cant update here * Simple change that should apply but in a code position where the op stack is nonempty * Equivalent code, but passing in the partial function as a single parameter, again, not updating
327a253
to
43d33a0
Compare
@hamzaremmal Squashed. Do you also want a rebase or no? |
Rebasing is not necessary unless there are conflicts. |
As @sjrd mentioned, there is no need. |
…fix expression.
Tests added for:
Fixes #20002