Skip to content

Add the missing type boundaries to the reactive integrations #2630

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

Closed
wants to merge 3 commits into from

Conversation

dkhalanskyjb
Copy link
Collaborator

No description provided.

Judging by ReactiveX/RxJava#4644, the
requirement 2.13 from the reactive spec
(https://github.com/reactive-streams/reactive-streams-jvm#2.13)
does mean that null values can't be passed to `onNext`. Thus, it
is incorrect for `publish {...}` to accept nullable values.
`flux` and `mono` now have <T : Any>. `flux`, because it's illegal
to emit `null` values, and `mono`, because it can be confusing for
the user to be able to write `mono<String?>` to create a `Mono`
that emits either `String` or no value at all.
This does not affect the range of representable programs, but,
without the type boundary, the users could be confused into
thinking that they could emit `null` as a value.
Copy link
Collaborator

@qwwdfsad qwwdfsad left a comment

Choose a reason for hiding this comment

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

Sorry, we've discussed it before and decided not to do that (the end of DM by 2020-09-23).

It's a source-incompatible change to stable API that will require all authors of generic code to introduce Any constraint.
And any code that actually tries to emit null will fail at the first run.

@qwwdfsad qwwdfsad closed this Apr 8, 2021
@dkhalanskyjb dkhalanskyjb deleted the reactive-missing-type-boundaries branch November 2, 2021 13:36
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.

2 participants