Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binding element 'any' implicitly has an 'any' type. #9657

Closed
normalser opened this issue Jul 13, 2016 · 4 comments
Closed

Binding element 'any' implicitly has an 'any' type. #9657

normalser opened this issue Jul 13, 2016 · 4 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@normalser
Copy link

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.

@mhegazy
Copy link
Contributor

mhegazy commented Jul 13, 2016

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}) {

}

@normalser
Copy link
Author

Shouldn't it be bug for 1.8 then ?

@mhegazy
Copy link
Contributor

mhegazy commented Jul 14, 2016

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 typescript@2.0.0

@StoneCypher
Copy link

I feel like a stronger error message should be emitted here. I don't think many people will easily find this.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants