Skip to content

Commit

Permalink
fix(typings): fixed Subject<T>.lift to have the same shape as Observa…
Browse files Browse the repository at this point in the history
…ble<T>.lift
  • Loading branch information
david-driscoll committed Oct 14, 2016
1 parent 4c31974 commit b07f597
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Subject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export class Subject<T> extends Observable<T> implements ISubscription {
return new AnonymousSubject<T>(destination, source);
};

lift<T, R>(operator: Operator<T, R>): Observable<T> {
lift<R>(operator: Operator<T, R>): Observable<T> {

This comment has been minimized.

Copy link
@masaeedu

masaeedu Jun 18, 2017

Contributor

Observable<T>#lift<R> returns an Observable<R>, so this isn't exactly identical. Perhaps we should revisit #1234

This comment has been minimized.

Copy link
@alexfung888

alexfung888 Jun 28, 2017

yes, now all programs fails to compile:

Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
  Types of property 'lift' are incompatible.
    Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'.
      Type 'Observable<T>' is not assignable to type 'Observable<R>'.
        Type 'T' is not assignable to type 'R'.
const subject = new AnonymousSubject(this, this);
subject.operator = operator;
subject.operator = <any>operator;
return <any>subject;
}

Expand Down

0 comments on commit b07f597

Please sign in to comment.