Closed
Description
This does not work. This is expected since I have "noImplicitAny": true
:
function test({ x, y }) {
console.log(x, y);
}
test({
x: 1,
y: 2
});
src\main.ts(15,17): error TS7005: Variable 'x' implicitly has an 'any' type.
src\main.ts(15,20): error TS7005: Variable 'y' implicitly has an 'any' type.
However, function test({ x:number, y:number }) {
does not works too, while function test({ x = 0, y = 0 }) {
works fine, but I do not want default params here. Is there a solution for it?