google / google/closure-compiler
getJsDocInfo for typedef'ed types returns the jsdoc of the last usage site.
Open
Types
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
Consider the following snippet:
``` javascript
/**
* @export
* @constructor
*/
typedef.C = function() {
/**
* The js doc attached to typedef.C.T type.
*
* @private
* @type {typedef.C.T}
*/
this.privateUsage = function() {};
};
/**
* The jsDoc we want, but can't obtain.
*
* @typedef {function(?):?}
*/
typedef.C.T;
```
When using the compiler apis for a custom pass, `typeRegistry.getType('typedef.C.T').getJsDocInfo()` returns the js doc on `this.privateUsage`, not the js doc at the typedef declaration site.
Contributor guide
Assessment
This issue has not been assessed yet.