TypeScript/tests/cases/compiler/noUnusedLocals_writeOnlyProperty_dynamicNames.ts
Andy 37d4f6a69d Mark references to dynamically-named properties as used (#21010)
* Mark references to dynamically-named properties as used

* Avoid showing the symbol ID

* Use symbolToString instead of showSymbol
2018-01-08 16:44:58 -08:00

14 lines
215 B
TypeScript

// @noUnusedLocals: true
// @lib: es6
const x = Symbol("x");
const y = Symbol("y");
class C {
private [x]: number;
private [y]: number;
m() {
this[x] = 0; // write-only
this[y];
}
}