TypeScript Version: Version 2.1.0-dev.20160712
Code
function test({a:any}) {
}
Expected behavior:
Should compile with --noImplicitAny
(compiles fine with 1.8.0)
Actual behavior:
error TS7031: Binding element 'any' implicitly has an 'any' type.
this is not a type annotation, this is a rename for the destructured propeortes. Please see http://www.typescriptlang.org/docs/handbook/variable-declarations.html#property-renaming
what you want is:
function test({a} : { a: any}) {
}
Shouldn't it be bug for 1.8 then ?
Shouldn't it be bug for 1.8 then ?
I am sure there was one logged, could not find it. it should be fixed in latest typescript@next
as well as [email protected]
I feel like a stronger error message should be emitted here. I don't think many people will easily find this.
Most helpful comment
this is not a type annotation, this is a rename for the destructured propeortes. Please see http://www.typescriptlang.org/docs/handbook/variable-declarations.html#property-renaming
what you want is: