jsdoc @template doesn't work correctly if the comment is before an object property name #17339
Labels
Bug
A bug in TypeScript
Domain: JSDoc
Relates to JSDoc parsing and type generation
Fixed
A PR has been merged for this issue
Milestone
TypeScript Version: 2.4.1 and 2.5.0-dev.20170719
Code
Expected behavior:
the type of
no_workaround
should be the same asyes_workaround
(<T>(a: T[]) => T
)Actual behavior:
it's something else:
<T>(a: any[]) => any
the type parameter from
@template
is added to the function's signature but it seems like it's not in scope for the other jsdoc tags (so they show an error and useany
), unless the comment block appears right before the function expression like inyes_workaround
The text was updated successfully, but these errors were encountered: