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
import{of}from'rxjs';import{startWith}from'rxjs/operators';import'rxjs/Rx';constob2$=of(1).startWith(// Expect error, got one :-)// Argument of type '"foo"' is not assignable to parameter of type 'number | SchedulerLike'.'foo',);constob$=of(1).pipe(startWith(// Expected error, but got none :-('foo',),);// OR, if we don't get an error, we should at least get a union:// $ExpectType Observable<number | string>// but got actual type Observable<{}>ob$;
Expected behavior
When using startWith inside of pipe, I would expect either:
the argument type must match the Observable's inner type
the return type should be a union of the Observable's inner type and the argument type
Bug Report
Current Behavior
When using
startWith
inside ofpipe
, the argument type is not validated and/or the return type may be incorrect.Reproduction
Expected behavior
When using
startWith
inside ofpipe
, I would expect either:Observable
's inner typeObservable
's inner type and the argument typeEnvironment
Possible Solution
Additional context/Screenshots
Related #2544
The text was updated successfully, but these errors were encountered: