TypeScript/tests/cases/compiler/noUnusedLocals_destructuringAssignment.ts
Andy e8b72aa7d9
Error on accessing private property through destructuring assignment, and mark property used (#26381)
* Error on accessing private property through destructuring assignment, and mark property used

* Factor out getTypeOfObjectLiteralDestructuringProperty
2018-08-13 14:08:00 -07:00

18 lines
249 B
TypeScript

// @noUnusedLocals: true
class C {
private x = 0;
m(): number {
let x: number;
({ x } = this);
return x;
}
private f(): Function {
let f: Function;
({ f } = this);
return f;
}
}