Skip to content

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

Closed
@magnushiie

Description

@magnushiie

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?

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions