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

Pr/2230 #2287

Merged
merged 5 commits into from Oct 8, 2020
Merged

Pr/2230 #2287

merged 5 commits into from Oct 8, 2020

Conversation

qwwdfsad
Copy link
Member

@qwwdfsad qwwdfsad commented Oct 7, 2020

Editable version of #2230

@ansman
Copy link
Contributor

ansman commented Oct 7, 2020

Now that I think about it it feels weird that singleOrNull ever throws. It feels like it should do what single() does but instead of throwing it returns null.

That is of course a pretty major change in behavior.

@qwwdfsad
Copy link
Member Author

qwwdfsad commented Oct 7, 2020

I've tried to align the implementation with our own singleOrNull implementation. Which is, by mistake, differs from singleOrNull from stdlib which is a major problem as it is.

@qwwdfsad qwwdfsad requested a review from elizarov October 7, 2020 20:50
@qwwdfsad qwwdfsad requested a review from elizarov October 8, 2020 09:09
Copy link
Contributor

@elizarov elizarov left a comment

Choose a reason for hiding this comment

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

🚀 Good to go

@qwwdfsad qwwdfsad merged commit 7897f70 into develop Oct 8, 2020
@qwwdfsad qwwdfsad deleted the pr/2230 branch October 8, 2020 09:50
recheej pushed a commit to recheej/kotlinx.coroutines that referenced this pull request Dec 28, 2020
* Allow nullable types in Flow.firstOrNull
* Allow nullable types in Flow.singleOrNull
* Align Flow.single and Flow.singleOrNull with Kotlin standard library

Fixes Kotlin#2229
Fixes Kotlin#2289

Co-authored-by: Nicklas Ansman Giertz <nicklas@ansman.se>
recheej pushed a commit to recheej/kotlinx.coroutines that referenced this pull request Dec 28, 2020
* Allow nullable types in Flow.firstOrNull
* Allow nullable types in Flow.singleOrNull
* Align Flow.single and Flow.singleOrNull with Kotlin standard library

Fixes Kotlin#2229
Fixes Kotlin#2289

Co-authored-by: Nicklas Ansman Giertz <nicklas@ansman.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants