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

JSDoc Allow {} around typecasts/declarations to be optional #19987

Closed
weswigham opened this issue Nov 13, 2017 · 0 comments
Closed

JSDoc Allow {} around typecasts/declarations to be optional #19987

weswigham opened this issue Nov 13, 2017 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Fixed A PR has been merged for this issue

Comments

@weswigham
Copy link
Member

weswigham commented Nov 13, 2017

TypeScript Version: 2.7.0-dev.201xxxxx

Code

        this._cachedTypeClasses[typeName] = /** @type function(new:Object) */ (object);

Expected behavior:
object cast to function(new:Object)

Actual behavior:

front_end/Runtime.js(398,24): error TS1138: Parameter declaration expected.

(Parse error on function keyword)

We've seen this before (and crashed on it), but choose not to make it not an error because it seemed wrong; however a lot of code that validates under closure compiler (namely the chrome devtools) appears to be written like this.

@weswigham weswigham added Bug A bug in TypeScript Salsa labels Nov 13, 2017
@mhegazy mhegazy added this to the TypeScript 2.7 milestone Nov 13, 2017
@mhegazy mhegazy added the Domain: JSDoc Relates to JSDoc parsing and type generation label Nov 13, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Nov 21, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants