Skip to content

Property used in destructuring assignment marked unused #26380

Closed
@ghost

Description

TypeScript Version: 3.1.0-dev.20180810

Code

class C {
    private x = 0;
    m(): number {
        let x: number;
        ({ x } = this);
        return x;
    }
}

Expected behavior:

No error.

Actual behavior:

src/a.ts:2:13 - error TS6133: 'x' is declared but its value is never read.

2     private x = 0;

Metadata

Metadata

Assignees

No one assigned

    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