TypeScript Version: 2.2.2 (VSCode 1.11.1 on macOS 10.12.4)
Code
// JavaScript.
/**
* @param {T} a
* @returns {function(): T}
* @template T
*/
function g(a) {
return () => a;
}
let h = g(1)();
Expected behavior: The type of h is inferred as number.
Actual behavior: The type of h is inferred as T...?

TypeScript Version: 2.2.2 (VSCode 1.11.1 on macOS 10.12.4)
Code
Expected behavior: The type of
his inferred asnumber.Actual behavior: The type of
his inferred asT...?