-
Notifications
You must be signed in to change notification settings - Fork 363
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
Revise Result type for Kotlin 1.5, remove restrictions #244
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @udalov suggestions.
Co-authored-by: Alexander Udalov <[email protected]>
Co-authored-by: Alexander Udalov <[email protected]>
Just read this KEEP as updated in this PR and there still places where:
I'm not sure if it's intended or not, but such inconsistency confused me during read |
Good catch. Thanks. Fixed. |
To alleviate that significant problem, I'm suggesting to make the lambda of all the That safety measure would limit usage of |
@LouisCAD fixing |
Sure @ilmirus , but in the meantime, it'd avoid a lot of bugs, and that crossinline can always be dropped later without affecting anyone. Is structured concurrency as a language feature something we can expect in the not too distant future? |
I've hit this too, but current behavior makes sense if you regard Personally, I often use Now that And in some (rare) cases it is preferrable to treat |
is there a discussion or proposal we can link to for why these restrictions were lifted? I've just been catching up on the original keep and discussion, but I don't see anything around this restriction being removed. So there's a gap for me between "Result is only allowed for restricted use cases" and "Result is only encouraged for restricted use cases". |
The original keep mentioned some potential future enhancements to support null-related operators like |
This is not needed anymore as of Kotlin 1.5, see [1]. [1]: Kotlin/KEEP#244 Signed-off-by: Sebastian Schuberth <[email protected]>
This is not needed anymore as of Kotlin 1.5, see [1]. [1]: Kotlin/KEEP#244 Signed-off-by: Sebastian Schuberth <[email protected]>
Result
type from functions.?.
,?:
and!!
on both nullable and non-nullResult
types.inline class
with@JvmInline value class
.