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

Update declaration of ts.Iterator to be compatible with ES2015 IteratorResult type #31214

Closed
ajafff opened this issue May 2, 2019 · 2 comments · Fixed by #30790
Closed

Update declaration of ts.Iterator to be compatible with ES2015 IteratorResult type #31214

ajafff opened this issue May 2, 2019 · 2 comments · Fixed by #30790
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript

Comments

@ajafff
Copy link
Contributor

ajafff commented May 2, 2019

TypeScript Version: 3.5.0-dev.20190502

Search Terms:

Code

I'm trying to use the API changes of #31101, but I run into assignability issues.

import * as ts from 'typescript';
return ts.getParsedCommandLineOfConfigFile('foo', {}, undefined!, new Map<string, ts.ExtendedConfigCacheEntry>());

Expected behavior:

No type error.

Actual behavior:

Argument of type 'Map<string, ExtendedConfigCacheEntry>' is not assignable to parameter of type 'Map<ExtendedConfigCacheEntry>'.
  Types of property 'keys' are incompatible.
    Type '() => IterableIterator<string>' is not assignable to type '() => Iterator<string>'.
      Type 'IterableIterator<string>' is not assignable to type 'Iterator<string>'.
        Types of property 'next' are incompatible.
          Type '(value?: any) => IteratorResult<string>' is not assignable to type '() => { value: never; done: true; } | { value: string; done: false; }'.
            Type 'IteratorResult<string>' is not assignable to type '{ value: never; done: true; } | { value: string; done: false; }'.
              Type 'IteratorResult<string>' is not assignable to type '{ value: string; done: false; }'.
                Types of property 'done' are incompatible.
                  Type 'boolean' is not assignable to type 'false'.
@weswigham weswigham added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels May 8, 2019
@rbuckton
Copy link
Member

rbuckton commented May 9, 2019

This isn't an issue with lib.d.ts, but our own definition in src/compiler/core.ts. This should be fixed when #30790 is merged.

@ajafff
Copy link
Contributor Author

ajafff commented Aug 4, 2019

@rbuckton this issue still exists with the latest nightly release. The error message is still the same. Can you please reopen this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants