10000 Type [number,number] is not recognized correctly · Issue #12579 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content
Type [number,number] is not recognized correctly #12579
Closed
@k8w

Description

@k8w

TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)
2.1.1

Code

type Data = [number, number];
let a:Data = [1,2,3,4,5].map(v=>[v, v+1]);

Expected behavior:
Compiled successfully.

Actual behavior:

test.ts(3,5): error TS2322: Type 'number[][]' is not assignable to type '[number, number]'.
Property '0' is missing in type 'number[][]'.

It seems work well in 2.0, throw this error after update to 2.1

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

      0