Skip to content

JSDocThisTag with no type expression has empty type expresison node #36693

Closed
@dsherret

Description

@dsherret

TypeScript Version: 3.8.0-dev.20200208

Search Terms: JSDocThisTag typeExpression

Code

const sourceFile = ts.createSourceFile("test.ts", `/**
 * @this - Some description.
 */
function test() {}`);

console.log(sourceFile.statements[0].jsDoc[0].tags[0].typeExpression);

Expected behavior: Undefined as type declaration has that as a possibility.

Actual behavior: { pos: 13, end: 13, ... }

Select Options -> typescript@next and check "Show internals":

https://ts-ast-viewer.com/#code/PQKhCgAIUgBAXAFgSwM6QLSQMoHsC2AppACaGoDGATsgA7zK4B2AdFCMOAGYCuTFDZpHjl4ACgCUkAN4BfIA

image

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions