google / google/closure-compiler
Templates should work for inner functions
Open
OTI
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
Templates defined in outer function should be visible in annotations of inner functions.
E.g. in the following code snippet, `TYPE` is not recognized as a type in jsdoc for `minus` function.
``` javascript
/**
* @param {TYPE} a
* @param {TYPE} b
* @template TYPE
* @return {TYPE}
*/
function max(a, b)
{
/**
* @param {TYPE} a
* @param {TYPE} b
* @return {TYPE}
*/
function minus(a, b)
{
return a - b;
}
return minus(a, b) < 0 ? b : a;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.