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

Consider "overriding" SharedFlow.collect to return Nothing #2789

Closed
lowasser opened this issue Jun 24, 2021 · 0 comments
Closed

Consider "overriding" SharedFlow.collect to return Nothing #2789

lowasser opened this issue Jun 24, 2021 · 0 comments
Labels

Comments

@lowasser
Copy link
Contributor

Since a SharedFlow never ends and collecting it "never completes normally," it'd be possible, semantically correct, and possibly illustrative to add a "fauxveride" of SharedFlow.collect returning Nothing.

Since it's an extension method, it can't actually be an override, but adding it as an overload should have effectively the same result.

Inspired by https://stackoverflow.com/q/68121398/869736.

@qwwdfsad qwwdfsad added the flow label Jun 25, 2021
qwwdfsad added a commit that referenced this issue Jul 1, 2021
    * Override will ensure the proper implementation of the interface
    * collect extension is added as the very basic lint helper

Fixes #2789
Fixes #2502
yorickhenning pushed a commit to yorickhenning/kotlinx.coroutines that referenced this issue Jan 28, 2022
Kotlin#2803)

* Introduce SharedFlow collect overload and override that return Nothing
* Override will ensure the proper implementation of the interface
* collect extension is added as the very basic lint helper

Fixes Kotlin#2789
Fixes Kotlin#2502

Co-authored-by: dkhalanskyjb <52952525+dkhalanskyjb@users.noreply.github.com>
pablobaxter pushed a commit to pablobaxter/kotlinx.coroutines that referenced this issue Sep 14, 2022
Kotlin#2803)

* Introduce SharedFlow collect overload and override that return Nothing
* Override will ensure the proper implementation of the interface
* collect extension is added as the very basic lint helper

Fixes Kotlin#2789
Fixes Kotlin#2502

Co-authored-by: dkhalanskyjb <52952525+dkhalanskyjb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants