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

3.x: Disambiguate startWith(T|Iterable<T>)? #6122

Closed
akarnokd opened this issue Aug 1, 2018 · 6 comments
Closed

3.x: Disambiguate startWith(T|Iterable<T>)? #6122

akarnokd opened this issue Aug 1, 2018 · 6 comments

Comments

@akarnokd
Copy link
Member

akarnokd commented Aug 1, 2018

We were using postfixes to avoid inference problems around operator methods (such as fromIterable vs fromArray) but there is at least one operator currently, startWith, that may exhibit type ambiguity. A dedicated postfixed name should resolve the issue, such as:

  1. startWith(T) + startWithIterable(Iterable<T>)
  2. startWithItem(T) + startWith(Iterable<T>) + remove startWith(T)
  3. startWithItem(T) + startWithIterable(Iterable<T>) + remove startWith(T).

As a preparation, we can deprecate startWith(T) within 2.2.x in case option 2 or 3 is chosen.

@akarnokd akarnokd added this to the 3.0 milestone Aug 1, 2018
@vanniktech
Copy link
Collaborator

The same also happens with some onError* methods.

I'm more inclined towards option 3 but no strong opinion.

@davidmoten
Copy link
Collaborator

For 3.x I'm happy with 3 also.

@davidmoten
Copy link
Collaborator

Perhaps instead of startWithItem we use startWithJust to match our just usage?

@RomanWuattier
Copy link
Contributor

That's just my two cents' worth I would opt for the option 3.

I think startWithJust could be confusing since other methods call just for example, range when the count value is one or fromArray when the length is one.

@akarnokd
Copy link
Member Author

3.x is now accepting PRs if somebody wants to tackle this.

@akarnokd
Copy link
Member Author

Closing via #6530.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants