-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Allow nullable types in Flow's firstOrNull extension #2230
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
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.
Thanks!
Could you please also remove Any
upper bound from singleOrNull
operator and add a corresponding unit test?
Done |
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.
assertFailsWith<NoSuchElementException> { flowOf<Int?>().singleOrNull() }
doesn't actually fail but returns null
instead. Added test doesn't pass
My bad. I'm unable to run the tests locally because java 6 is needed. |
@ansman Read the updated |
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.
This closes #2229