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

Incorrect Java code generated for verbs with primitive response type #2757

Closed
tomdaffurn opened this issue Sep 20, 2024 · 0 comments · Fixed by #3110
Closed

Incorrect Java code generated for verbs with primitive response type #2757

tomdaffurn opened this issue Sep 20, 2024 · 0 comments · Fixed by #3110
Assignees
Labels
bug Something isn't working jvm

Comments

@tomdaffurn
Copy link
Contributor

When a Java module depends on a verb with primitive response type, and non-primitive param type, the generated Java verb client doesn't compile.

The generated client should use boxed types instead of primitives to match the xyz.block.ftl.VerbClient interface.

This verb:

//ftl:verb export
func TheVerb(ctx context.Context, val string) (int, error) {
    return 1, nil
}

Creates this generated client:

@VerbClientDefinition(
    name = "theVerb",
    module = "example"
)
public interface TheVerbClient extends VerbClient<String, Long> {
  long call(@NotNull String value);
}

Compilation of this client fails with:

[ERROR] <module>/TheVerbClient.java:[13,8] call(@org.jetbrains.annotations.NotNull String) in ftl.example.TheVerbClient clashes with call(P) in xyz.block.ftl.VerbClient
[ERROR] return type long is not compatible with java.lang.Long

@tomdaffurn tomdaffurn added bug Something isn't working jvm labels Sep 20, 2024
@github-actions github-actions bot added the triage Issue needs triaging label Sep 20, 2024
This was referenced Sep 20, 2024
@tomdaffurn tomdaffurn self-assigned this Sep 23, 2024
@github-actions github-actions bot removed the triage Issue needs triaging label Sep 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 jvm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant