Reactive-Extensions / RxJS

The Reactive Extensions for JavaScript
http://reactivex.io
Other
19.49k stars 2.1k forks source link

Compilation error with Typescript 2.6 and strictFunctionTypes on #1528

Closed mikeyoon closed 6 years ago

mikeyoon commented 6 years ago

With typescript 2.6 and --strictFunctionTypes enabled in tsconfig, there's a compilation error in rxjs/scheduler/VirtualTimeScheduler.d.ts. Error is as follows:

(22,22): error TS2415: Class 'VirtualAction<T>' incorrectly extends base class 'AsyncAction<T>'.
  Types of property 'work' are incompatible.
    Type '(this: VirtualAction<T>, state?: T) => void' is not assignable to type '(this: AsyncAction<T>, state?: T) => void'.
      The 'this' types of each signature are incompatible.
        Type 'AsyncAction<T>' is not assignable to type 'VirtualAction<T>'.
          Property 'index' is missing in type 'AsyncAction<T>'.

Looking at the code, removing the this parameter in work function would fix the issue, but I assume there's some reason for explicitly typing this.

mikeyoon commented 6 years ago

Looks like this is the wrong repo for this.