镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Description

cc Andy (Andrewkraft) (@Andy-MS)

TypeScript Version: 2.7.0-dev.20171223

Code

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

Expected behavior:

a is string.

Actual behavior:

a is any.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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