1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
//// [declarationEmitNestedGenerics.ts]
function f<T>(p: T) {
let g: <T>(x: T) => typeof p = null as any;
return g;
}
function g<T>(x: T) {
let y: typeof x extends (infer T)[] ? T : typeof x = null as any;
return y;
}
//// [declarationEmitNestedGenerics.js]
function f(p) {
var g = null;
return g;
}
function g(x) {
var y = null;
return y;
}
//// [declarationEmitNestedGenerics.d.ts]
declare function f<T>(p: T): <T_1>(x: T_1) => T;
declare function g<T>(x: T): T extends (infer T_1)[] ? T_1 : T;
|