TypeScript/tests/cases/conformance/jsdoc/instantiateTemplateTagTypeParameterOnVariableStatement.ts
Nathan Shively-Sanders 7ca6334dbd
Look for outer type parameters on VariableStatements (#37819)
This only applies in JS, where `@template` tags can apply to
initialisers of variable declarations:

```js
/**
 * @template T
 * @returns {(b: T) => T}
 */
const seq = a => b => b
```

Fixes #36201
2020-04-07 08:04:33 -07:00

18 lines
351 B
TypeScript

// @checkJs: true
// @allowJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @filename: instantiateTemplateTagTypeParameterOnVariableStatement.js
/**
* @template T
* @param {T} a
* @returns {(b: T) => T}
*/
const seq = a => b => b;
const text1 = "hello";
const text2 = "world";
/** @type {string} */
var text3 = seq(text1)(text2);