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 #32890

Closed
ajafff opened this issue Aug 14, 2019 · 1 comment · Fixed by #41507
Closed

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

ajafff opened this issue Aug 14, 2019 · 1 comment · Fixed by #41507
Assignees
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status. Rescheduled This issue was previously scheduled to an earlier milestone

Comments

@ajafff
Copy link
Contributor

ajafff commented Aug 14, 2019

This is the same issue as #31214 as that one was closed even though the error still exists in the most recent nightly build.

TypeScript Version: 3.6.0-dev.20190814

Search Terms:

Code

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

// @strict: true
// @target: es2015
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'.
@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Aug 16, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.7.0 milestone Aug 16, 2019
@PhoenixHe-NV
Copy link

PhoenixHe-NV commented Aug 29, 2019

I have the same issue here. After upgrading to typescript 3.6.2 my project failed to compile because of IterableIterator<string> and Iterator<string> are not compatible.

@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label Aug 31, 2020
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status. Rescheduled This issue was previously scheduled to an earlier milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants