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

Trait codegen doesn't like Document in collections #2312

Closed
kubukoz opened this issue Jun 6, 2024 · 0 comments · Fixed by #2313
Closed

Trait codegen doesn't like Document in collections #2312

kubukoz opened this issue Jun 6, 2024 · 0 comments · Fixed by #2313

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Jun 6, 2024

Tested against 1.49.0.

Example 1:

@trait()
list documents {
    member: Document
}
public static DocumentsTrait fromNode(Node node) {
    Builder builder = builder();
    node.expectArrayNode()
        .getElements().stream()
        .map(n -> ) //error here
        .forEach(builder::addValues);
    return builder.build();
}

Example 2:

@trait()
map documents {
    key: String
    value: Document
}
public static DocumentsTrait fromNode(Node node) {
    Builder builder = builder();
    node.expectObjectNode().getMembers().forEach((k, v) -> {
        builder.putValues(k.expectStringNode().getValue(), ); //error here
    });
    return builder.build();
}
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 a pull request may close this issue.

1 participant