TypeScript/tests/cases/conformance/jsdoc/typeTagWithGenericSignature.ts
Nathan Shively-Sanders a2e4a282e7
Get [type] parameter types from @type tag (#26694)
* Get [type] parameter types from @type tag

Previously only the return type was used in cases like this:

```js
/** @type {<T>(param?: T) => T | undefined} */
function g(param) {
  return param;
}
```

Now the type parameters from the type tag are used, and the compiler
gets the type of the parameter by using the position in the signature of
the type tag.

Fixes #25618

* Fix split ifs according to PR comments
2018-08-27 16:52:35 -07:00

14 lines
208 B
TypeScript

// @checkJs: true
// @allowJs: true
// @noEmit: true
// @strict: true
// @Filename: bug25618.js
/** @type {<T>(param?: T) => T | undefined} */
function typed(param) {
return param;
}
var n = typed(1);