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

IxJS not compatible with typescript 2.7 #214

Closed
patsissons opened this issue Feb 5, 2018 · 2 comments · Fixed by #215
Closed

IxJS not compatible with typescript 2.7 #214

patsissons opened this issue Feb 5, 2018 · 2 comments · Fixed by #215

Comments

@patsissons
Copy link
Contributor

IxJS version:
2.3.4

Code to reproduce:
this is a type declaration error, so any usage of tsc with the current version of ix will fail.

Expected behavior:
no compilation errors

Actual behavior:
example output (using the webpack at-loader)

ERROR in [at-loader] ./node_modules/ix/add/asynciterable-operators/concat.ts:63:10
    TS2556: Expected 1-6 arguments, but got 1 or more.

ERROR in [at-loader] ./node_modules/ix/add/asynciterable-operators/merge.ts:63:10
    TS2556: Expected 1-6 arguments, but got 1 or more.

ERROR in [at-loader] ./node_modules/ix/add/iterable-operators/concat.ts:54:10
    TS2556: Expected 1-6 arguments, but got 1 or more.

Additional information:
There are some missing exports on the above 3 mentioned files that declare the catch all function signatures (exports without implementation). I'm not completely certain what changed from 2.6.x to 2.7.x, but there was some change that now requires these additional exports when overloading a function signature. I will be publishing a PR for this fix shortly.

@patsissons
Copy link
Contributor Author

Until #215 is merged, there is a work around by performing some unconventional augmentations.

import { IterableX } from 'ix/iterable/iterablex';
import { AsyncIterableX } from 'ix/asynciterable/asynciterablex';

declare module 'ix/iterable/concat' {
  // @ts-ignore: static function overload augmentation
  function concat<T>(source: IterableX<T>, ...args: Iterable<T>[]): IterableX<T>;
}

declare module 'ix/asynciterable/concat' {
  // @ts-ignore: static function overload augmentation
  function concat<T>(source: AsyncIterableX<T>, ...args: AsyncIterable<T>[]): AsyncIterableX<T>;
}

declare module 'ix/asynciterable/merge' {
  // @ts-ignore: static function overload augmentation
  function merge<T>(source: AsyncIterableX<T>, ...args: AsyncIterable<T>[]): AsyncIterableX<T>;
}

@trxcllnt
Copy link
Member

trxcllnt commented Feb 6, 2018

thanks @patsissons, I was worried we might see some issues with 2.7. Will validate the fix (and maybe fix CI) later tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants