Skip to content

Property used in destructuring assignment marked unused #26380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Aug 11, 2018 · 0 comments
Closed

Property used in destructuring assignment marked unused #26380

ghost opened this issue Aug 11, 2018 · 0 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@ghost
Copy link

ghost commented Aug 11, 2018

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;
@ghost ghost added the Bug A bug in TypeScript label Aug 11, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Aug 11, 2018
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.2 milestone Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

1 participant