Skip to content

“T[][] is not assignable to Iterable<[T, T]>” while it is (at compile time) #7799

Closed
@msklvsk

Description

@msklvsk

TypeScript Version:

1.8.9

Code

new Map<number, number>([1, 2].map(x => [x, x]));

// Error:
// Argument of type 'number[][]' is not assignable to parameter of type 'Iterable<[number, number]>'…

Expected behavior: types are inferred correctly, no error shown.
Actual behavior: type error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions