-
Notifications
You must be signed in to change notification settings - Fork 129
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
Kotlin - ifNotNull offers a nullable receiver #901
Comments
Would like to explore, were and which Options: https://kotlinlang.org/docs/java-interop.html#nullability-annotations Guess jsr305 will make the race: https://kotlinlang.org/docs/java-interop.html#jsr-305-support With an own nicknamed annotation type, for best flexibility - WDYT? |
Thank you for the exploration. I would tend to Also |
Thank you for your thoughts. I would like to provide the type-safety, but also avoid shipping an additional dependency for that purpose. What about some own Mutiny annotations, and the associated compiler options in the guide? |
That sounds nice. Here are additional resources: |
Ok... What's described in your mentioned ticket
It's not consistent right now, so hopefully becomes better with Kotlin 1.7. So for now, it's not possible to include type safety without shipping additional libraries, and even with them, it's not consistent between Intellij and the Kotlin compiler. We could try to add
@jponge, I would like to hear your opinion on this - and maybe if there's further added value on hinting nullable in Mutiny (or if there's already something present in other smallrye projects, that can be adopted. |
Also I see that Also the |
Issue to be postponed for... some while. |
Context
A
.transform
returns either a null or a value.Using
.onItem().ifNotNull().call { entity ->
gives a nullableentity
and kotlin complains.Description
ifNotNull
offers a nullable receiver. Kotlin complains and wants a null-check.Additional details
Using Java 18.0.1, Kotlin 1.6.10 and Quarkus 2.8.1.Final
The text was updated successfully, but these errors were encountered: