Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link

Description

@ajafff
Issue body actions

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'.
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.