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

Consider parenthesized expressions with JSDoc to be a form of type assertions #5158

Closed
DanielRosenwasser opened this issue Oct 7, 2015 · 3 comments
Assignees
Labels
Domain: JSDoc Relates to JSDoc parsing and type generation Fixed A PR has been merged for this issue Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

To quote @weswigham on #4447 (comment):

in [the] closure compiler you do inline casts with jsdoc comments like so:

var x = /** @type {Foo.Bar} */ (y);

We should consider supporting this in Salsa.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Salsa labels Oct 7, 2015
@weswigham
Copy link
Member

Also type assertions in the form:

/** @type {Foo.Bar} */ var x = y;

and (in constructors:)

/** @type {Foo.Bar} */
this._foo = undefined;

which I believe are also both recognized as type annotations by the closure compiler.

@DanielRosenwasser
Copy link
Member Author

DanielRosenwasser commented Jul 12, 2017

@rbuckton @weswigham discuss which of you would like to take this on.

@m1ck2
Copy link

m1ck2 commented Jun 7, 2018

@ikatyang fix(JavaScript): can you’ve show me where to find this sub-menu please ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: JSDoc Relates to JSDoc parsing and type generation Fixed A PR has been merged for this issue Suggestion An idea for TypeScript
5 participants