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

TypeError: Cannot read property 'type' of undefined at getJSDocTypeForVariableLikeDeclarationFromJSDocComment #7002

Closed
magnushiie opened this issue Feb 10, 2016 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@magnushiie
Copy link
Contributor

With the current master, the compiler crashes when the @type JSDoc annotation of a variable is malformed, e.g. in the following (shortened) example from lodash:

/**
 * Checks if `value` is classified as an `Array` object.
 *
 * @type Function
 */
var isArray = Array.isArray;

This is in the statement return annotation.typeExpression.type;;

This compiles fine if Function above is replaced with {Function}.

It seems this is similar to #6709 and annotation.typeExpression needs checking too.

I could submit a PR, but I understand from CONTRIBUTING.md that the issue needs approval first?

@billti
Copy link
Member

billti commented Feb 10, 2016

@RyanCavanaugh Seems like possibly the same root cause as #6984 .

@billti billti added Bug A bug in TypeScript Salsa labels Feb 10, 2016
@billti billti added this to the TypeScript 1.8.2 milestone Feb 10, 2016
@RyanCavanaugh
Copy link
Member

Thanks for the report!

FWIW in the future if you find a crashing bug, we'll pretty much always accept PRs on those -- no need to wait for any action. But hopefully that doesn't happen again 😉

RyanCavanaugh added a commit to RyanCavanaugh/TypeScript that referenced this issue Feb 10, 2016
RyanCavanaugh added a commit to RyanCavanaugh/TypeScript that referenced this issue Feb 10, 2016
@RyanCavanaugh RyanCavanaugh added the Fixed A PR has been merged for this issue label Feb 10, 2016
RyanCavanaugh added a commit to RyanCavanaugh/TypeScript that referenced this issue Feb 11, 2016
RyanCavanaugh added a commit to RyanCavanaugh/TypeScript that referenced this issue Feb 11, 2016
@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
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants