Skip to content

Cannot use generic types in JsDoc #6814

@billti

Description

@billti

Generic types may not be specified for variable, param, or return types currently. For example, both of the below just show up as 'any's.

/** @type {PromiseLike<string>} */
var a9;

/**
 * @return {PromiseLike<string>}
 */
function f9(){}

We should support this using a syntax like that show above, which closely matches TypeScript's and is covered in the Closure Compiler docs also (https://developers.google.com/closure/compiler/docs/js-for-compiler#instantiating-a-generic-type)

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