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

Nested records generates toplevel matchers #3

Closed
runeflobakk opened this issue Jan 30, 2024 · 0 comments · Fixed by #8
Closed

Nested records generates toplevel matchers #3

runeflobakk opened this issue Jan 30, 2024 · 0 comments · Fixed by #8
Assignees
Labels
enhancement New feature or request

Comments

@runeflobakk
Copy link
Owner

E.g. if you have

package my.package;
public class TopLevel {
    public record R(int i) {}
}

The generated matcher will be:

package my.package;
public class RMatcher implements Matcher<TopLevel.R> { ... }

This means that if you have two records with the same (simple) name, defined in each of their top level class in the same package (which is perfectly valid), the code generator will (try to) generate an RMatcher for each of them in the same package, and thus resulting in a clash.

Possible solutions

  • include the name of the top level class in the generated matcher's class name. I.e. in the example above, instead generate TopLevelRMatcher.
  • other means for manually configuring resolution
@runeflobakk runeflobakk added the enhancement New feature or request label Jan 30, 2024
@runeflobakk runeflobakk self-assigned this Mar 11, 2024
runeflobakk added a commit that referenced this issue Mar 11, 2024
Or, well, a function, if you want.
Default implementation with support for nested records, fixes #3
runeflobakk added a commit that referenced this issue Mar 11, 2024
Or, well, a function, if you want.
Default implementation with support for nested records, fixes #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant