You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In src/operator/publishReplay.ts, the delegating call to higherOrder (which is an alias for publishReplay in src/operators/publishReplay.ts), has arguments that don't provide enough information to infer type arguments. That's because the third argument is cast to any, which is because it's just a delegation; a call to publishReplay could delegate to any of the three overloads of higherOrder. The compiler has to choose one, however, and it chooses the wrong one in Typescript 2.6.
RxJS version:
master
Code to reproduce:
Update typescript to typescript@next then try to npm run build_all
Expected behavior:
No compile error
Actual behavior:
Type Observable<{}> is not assignable to type Observable<R> | ConnectableObservable<R>
The text was updated successfully, but these errors were encountered:
operator/publishReplay delegates to operators/publishReplay. The call is
correct — *one* of the three overloads will be called, and it
doesn't matter which — but
the compiler has to choose one overload. Previously, the call didn't
include type arguments, and the type of the one argument that would be
used for inference, selectorOrScheduler, was of type `any`. So the
compiler chose the first overload with four parameters. However, the
return type of this overload is incorrect, whereas the return type of the
third overload is correct. Provide the type
arguments explicitly so that the last, most general overload gets called. This
results in the the correct return type, `OperatorFunction<T, R>`.
ClosesReactiveX#2991
In src/operator/publishReplay.ts, the delegating call to
higherOrder
(which is an alias forpublishReplay
in src/operators/publishReplay.ts), has arguments that don't provide enough information to infer type arguments. That's because the third argument is cast toany
, which is because it's just a delegation; a call topublishReplay
could delegate to any of the three overloads ofhigherOrder
. The compiler has to choose one, however, and it chooses the wrong one in Typescript 2.6.RxJS version:
master
Code to reproduce:
Update typescript to
typescript@next
then try tonpm run build_all
Expected behavior:
No compile error
Actual behavior:
Type
Observable<{}>
is not assignable to typeObservable<R> | ConnectableObservable<R>
The text was updated successfully, but these errors were encountered: