TypeScript Version: 2.7.0-dev.20171220
Code
/** @typedef {U} T *//** * @template U * @param {U} x * @return {T} */functionf(x){returnx;}/** @type T */constx=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.
TypeScript Version: 2.7.0-dev.20171220
Code
Expected behavior:
We shouldn't be able to access
Uin the definition forT. Doing so leads to strange behavior later on.Actual behavior:
We can. But then we can't use
Tanywhere because it leaksU.