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 fails to parse constructor declarations #4704

Closed
sambsnyd opened this issue Nov 23, 2024 · 0 comments · Fixed by #4706
Closed

Groovy parser fails to parse constructor declarations #4704

sambsnyd opened this issue Nov 23, 2024 · 0 comments · Fixed by #4706
Assignees
Labels
bug Something isn't working

Comments

@sambsnyd
Copy link
Member

sambsnyd commented Nov 23, 2024

I haven't categorized exactly why this fails to parse yet in a way that is fully distinct from other issues, but this code should parse and instead throws an exception:

class Pair {
    String foo
    String bar
    Pair(String foo, String bar) {
        this.foo = foo
        this.bar = bar
    }
}

class A {
    def foo(List l) {
        l.add(new Pair("foo", "bar"))
        l.add(new Pair("foo", "bar"))
        l.add(new Pair("foo", "bar"))
        l.add(new Pair("foo", "bar"))
    }
}

Reproduced in test CompilationUnitTest.addingToMaps()

@sambsnyd sambsnyd added the bug Something isn't working label Nov 23, 2024
@knutwannheden knutwannheden changed the title Groovy parser fails to parse this sample Groovy parser fails to parse constructor declarations Nov 23, 2024
knutwannheden added a commit that referenced this issue Nov 23, 2024
@timtebeek timtebeek moved this to In Progress in OpenRewrite Nov 23, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Nov 23, 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
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants