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

toErrorIfNull to return Result with non-null value. #86

Closed

Conversation

kirillzh
Copy link

@kirillzh kirillzh commented May 9, 2023

Resolves #84

@@ -192,7 +192,7 @@ class MapTest {

@Test
fun returnsTransformedErrorIfNull() {
val result = Ok(null).toErrorIfNull { "a" }
val result: Result<Nothing, String> = Ok(null).toErrorIfNull { "a" }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not have compiled before because the return type of toErrorIfNull was Result<Nothing?, String> which should not be possible.

@michaelbull
Copy link
Owner

Merged in d7dbf35

@michaelbull
Copy link
Owner

Released in v1.1.18

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 this pull request may close these issues.

ensureNotNull-alike binding scope extensions
2 participants