Skip to content

Destructuring assignment makes any types when it skips some elements (regression) #20872

Closed
@falsandtru

Description

@falsandtru

cc @Andy-MS

TypeScript Version: 2.7.0-dev.20171223

Code

const [, a = ''] = ''.match('') || [];

Expected behavior:

a is string.

Actual behavior:

a is any.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions