2018-05-03 23:00:52 +02:00
|
|
|
// @lib: es5
|
|
|
|
// @noUnusedLocals:true
|
2016-12-08 23:35:35 +01:00
|
|
|
|
|
|
|
declare var console: { log(a: any): void };
|
|
|
|
|
|
|
|
function one() {
|
|
|
|
const foo = { a: 1, b: 2 };
|
|
|
|
// 'a' is declared but never used
|
|
|
|
const {a, ...bar} = foo;
|
|
|
|
console.log(bar);
|
|
|
|
}
|
|
|
|
|
|
|
|
function two() {
|
|
|
|
const foo = { a: 1, b: 2 };
|
|
|
|
// '_' is declared but never used
|
|
|
|
const {a: _, ...bar} = foo;
|
|
|
|
console.log(bar);
|
|
|
|
}
|
|
|
|
|
2016-12-09 00:12:35 +01:00
|
|
|
function three() {
|
|
|
|
const foo = { a: 1, b: 2 };
|
|
|
|
// 'a' is declared but never used
|
|
|
|
const {a, ...bar} = foo; // bar should be unused
|
|
|
|
//console.log(bar);
|
|
|
|
}
|
|
|
|
|
|
|
|
function four() {
|
|
|
|
const foo = { a: 1, b: 2 };
|
|
|
|
// '_' is declared but never used
|
|
|
|
const {a: _, ...bar} = foo; // bar should be unused
|
|
|
|
//console.log(bar);
|
|
|
|
}
|