Closed
Description
TypeScript Version: 3.0.0-dev.20180712
Search Terms:
Code
// @checkJs: true
// @allowJs: true
// @filename: test.js
/** @type {<T>(param?: T) => T | undefined} */
function typed(param) {
return param;
}
typed(1);
Expected behavior:
Either param
doesn't get it's type from the @type
tag or the type parameter T
applies to the function.
Actual behavior:
Argument of type '1' is not assignable to parameter of type 'T | undefined'.
Playground Link: not possible
Related Issues: #25525