Skip to content

Jsdoc @template issue in syntactic classifier #8676

Closed
@basarat

Description

@basarat

Consider the following:

/**
 * @template T
 */
function ident<T>(x:T):T {
    return ident;
}

getEncodedSyntacticClassifications will fail with Cannot read property 'text' of undefined

Stack:

NodeObject.createChildren   @   ntypescript.js:50808
NodeObject.getChildren  @   ntypescript.js:50845
processJSDocTemplateTag @   ntypescript.js:56304
classifyJSDocComment    @   ntypescript.js:56270
classifyComment @   ntypescript.js:56243
classifyLeadingTriviaAndGetTokenStart   @   ntypescript.js:56213
tryClassifyNode @   ntypescript.js:56345
processElement  @   ntypescript.js:56482
processElement  @   ntypescript.js:56484
processElement  @   ntypescript.js:56484
getEncodedSyntacticClassifications  @   ntypescript.js:56185

Reason: sourceFile is undefined somewhere in the stack

Version : latest as of this morning

refs alm-tools/alm#82 🌹

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelates to the public API for TypeScriptBugA 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