Skip to content

tuple type don't check number of elements #5259

Closed
@co-dh

Description

@co-dh

The following compiles,

    var foo:[string, string] = ['','', '', '']

while this one not:

    var foo:[string, string] = ['','', '', 1]

The first one should not compiles, since the initializer has 3 elements while the type says 2.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptBy DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions