Closed
Description
TypeScript Version: 2.1.0-dev.20161003
Code
class Animal {
constructor(private species: string) {
}
printSpecies() {
let { species } = this;
console.log(species);
}
}
Expected behavior:
If I have the noUnusedLocals
option enabled, the code should compile without warnings because the species
property is being used.
Actual behavior:
If I have the noUnusedLocals
option enabled, I receive:
src/index.ts(2,23): error TS6138: Property 'species' is declared but never used.