Skip to content

Soundness issue with Array.prototype.concat and arrays of arrays #19535

Closed
@andyfriesen

Description

@andyfriesen

TypeScript Version: 2.7.0-dev.201xxxxx

Code

const foo: [number, string][] = [[1, 'one']];
console.log(foo.concat([2, 'two']));

Expected behavior:
Either [[1, 'one'], [2, 'two']] or a type error.

Actual behavior:
[[1, 'one'], 2, 'two']

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions