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

Groovy parser does not support multiple assignments #4756

Open
jevanlingen opened this issue Dec 9, 2024 · 0 comments
Open

Groovy parser does not support multiple assignments #4756

jevanlingen opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working parser-groovy

Comments

@jevanlingen
Copy link
Contributor

jevanlingen commented Dec 9, 2024

What is the smallest, simplest way to reproduce the problem?

@Test
void multipleAssignments() {
    rewriteRun(
        groovy(
            """
            def (a, b) = ['1', '2']
            """
        )
     );
 }

What did you expect to see?

Working tests

What did you see instead?

Failed to parse file.groovy at cursor position 0. The next 10 characters in the original source are `def (a, b)`

Pointers

There is no implementation yet. In the GroovyParserVisitor you can see this:

if (expression.isMultipleAssignmentDeclaration()) {
    // def (a, b) = [1, 2]
    throw new UnsupportedOperationException("Parsing multiple assignment (e.g.: def (a, b) = [1, 2]) is not implemented");
}
@jevanlingen jevanlingen added the bug Something isn't working label Dec 9, 2024
@timtebeek timtebeek moved this to Ready to Review in OpenRewrite Dec 13, 2024
@timtebeek timtebeek moved this from Ready to Review to In Progress in OpenRewrite Dec 13, 2024
@timtebeek timtebeek moved this from In Progress to Backlog in OpenRewrite Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser-groovy
Projects
Status: Backlog
Development

No branches or pull requests

1 participant