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

publish's selector doesn't have return type captured in generics in TypeScript #2889

Closed
benlesh opened this issue Oct 2, 2017 · 1 comment
Labels
bug Confirmed bug TS Issues and PRs related purely to TypeScript issues

Comments

@benlesh
Copy link
Member

benlesh commented Oct 2, 2017

RxJS version: 5.4.x

Code to reproduce:

const result: Observable<string> = of<number>(1, 2, 3).publish(source => source.map(x => x + '!'))
                                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected behavior:

No errors, proper type inferrence

Actual behavior:

error TS2345: Argument of type '(source: Observable<number>) => Observable<string>' is not assignable to parameter of type 'selector<number>'.
  Type 'Observable<string>' is not assignable to type 'Observable<number>'

Additional information:
TS 2.4

@benlesh benlesh added bug Confirmed bug TS Issues and PRs related purely to TypeScript issues labels Oct 2, 2017
cartant added a commit to cartant/rxjs that referenced this issue Oct 3, 2017
Fixes the typings for publish and multicast, so that selectors that
change the observable's type are supported.

Closes ReactiveX#2889
cartant added a commit to cartant/rxjs that referenced this issue Oct 4, 2017
Fixes the typings for publish and multicast, so that selectors that
change the observable's type are supported.

Closes ReactiveX#2889
cartant added a commit to cartant/rxjs that referenced this issue Oct 4, 2017
Fixes the typings for publish and multicast, so that selectors that
change the observable's type are supported.

Closes ReactiveX#2889
cartant added a commit to cartant/rxjs that referenced this issue Oct 4, 2017
Fixes the typings for publish and multicast, so that selectors that
change the observable's type are supported.

Closes ReactiveX#2889
@benlesh benlesh closed this as completed in 9ee234d Oct 5, 2017
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Confirmed bug TS Issues and PRs related purely to TypeScript issues
Projects
None yet
Development

No branches or pull requests

1 participant