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

Cannot find symbol in code generated with addSingleItemCollectionBuilders #141

Open
mwisnicki opened this issue Feb 2, 2023 · 2 comments
Labels
awaiting-more-information bug Something isn't working duplicate This issue or pull request already exists

Comments

@mwisnicki
Copy link

Code:

@RecordBuilder
@RecordBuilder.Options(addSingleItemCollectionBuilders = true)
record Person(String name, int age, Map<String, Object> other) implements PersonBuilder.With {}

POM:

    <dependencies>
        <dependency>
            <groupId>io.soabase.record-builder</groupId>
            <artifactId>record-builder-processor</artifactId>
            <version>35</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

Compiler error:

\target\generated-sources\annotations\org\example\PersonBuilder.java:141:22
java: cannot find symbol
  symbol:   method __map(java.util.Map<capture#1 of ? extends java.lang.String,capture#2 of ?>)
  location: class org.example.PersonBuilder

Generated snippet:

    /**
     * Re-create the internally allocated {@code Map<String, Object>} for {@code other} by copying the argument
     */
    @Generated("io.soabase.recordbuilder.core.RecordBuilder")
    public PersonBuilder other(Map<? extends String, ?> other) {
        this.other = __map(other);
        return this;
    }

There is no __map defined anywhere
Lists fail the same way with missing __list.

@mwisnicki
Copy link
Author

OpenJDK18 on Win11

@Randgalt
Copy link
Owner

Randgalt commented Feb 4, 2023

This is a duplicate of #129 I believe. We don't have a good solution yet. I had a PR but it was not acceptable by the community. I didn't write the original PR that is causing the error and I'm not sure what the correct solution is here. I'd really like the community to detail what the correct behavior should be.

@Randgalt Randgalt added duplicate This issue or pull request already exists awaiting-more-information bug Something isn't working labels Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-more-information bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants