File: declarationEmitNestedGenerics.js

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (25 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
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;