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

Awakeable handle annotated with @NotNull but needs null for VOID types #357

Closed
StephanEwen opened this issue Jul 4, 2024 · 3 comments · Fixed by #361
Closed

Awakeable handle annotated with @NotNull but needs null for VOID types #357

StephanEwen opened this issue Jul 4, 2024 · 3 comments · Fixed by #361
Labels
bug Something isn't working

Comments

@StephanEwen
Copy link
Contributor

For VOID typed awakeables, the value passed during resolution is null but the handler is annotated to not accept that.

image

@slinkydeveloper slinkydeveloper added the bug Something isn't working label Jul 4, 2024
@slinkydeveloper
Copy link
Contributor

slinkydeveloper commented Jul 25, 2024

Unfortunately I don't really have a good solution that solves it with the nullness annotations. I see two ways of solving this:

* Either have a variant resolve() without arguments.
* Or have some marker unit value (a-la kotlin Unit), e.g. Unit.INSTANCE or something like that.

I think I'll go with the former

@slinkydeveloper
Copy link
Contributor

slinkydeveloper commented Jul 25, 2024

Perhaps this @NonNull is indeed too restrictive to begin with. I'll remove it for the time being.

@slinkydeveloper
Copy link
Contributor

I've figured that with JSpecify I can enforce this directly on the Serde annotation, and not on the individual context methods. Working on this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants