Closed

Description
TypeScript Version: 2.7.0-dev.20171220
Code
/** @typedef {U} T */
/**
* @template U
* @param {U} x
* @return {T}
*/
function f(x) {
return x;
}
/** @type T */
const x = 3;
Expected behavior:
We shouldn't be able to access U
in the definition for T
. Doing so leads to strange behavior later on.
Actual behavior:
We can. But then we can't use T
anywhere because it leaks U
.