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

fix(707): do not throw if the record-pattern contains dims #708

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clementdessoude
Copy link
Contributor

What changed with this PR:

This piece of code was failing as the java-parser tried to parse String otherName, String[] otherContent as a variable declaration list instead of component pattern list

I added backtrack lookahead which fixed the issue but will see if we can avoid it completely.

// Input
public class Foo {
  public void bar() {
    if (!(obj instanceof Project(String otherName, String[] otherContent))) {
      return false;
    }
  }
}

Relative issues or prs:

#707

@clementdessoude clementdessoude force-pushed the fix/707-record-pattern-with-dims branch 6 times, most recently from 2a2ce50 to f16b22c Compare December 22, 2024 00:37
@clementdessoude clementdessoude force-pushed the fix/707-record-pattern-with-dims branch from f16b22c to 8d79c4d Compare December 22, 2024 09:02
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.

1 participant