google / google/closure-compiler

Templates should work for inner functions

Open
#490 5 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.