TypeScript/tests/cases/compiler/declarationEmitNestedGenerics.ts
Wesley Wigham 6149b41469
Generate names for type parameter declarations in inferred types (#23902)
* Generate names for type parameter declarations in inferred types

* Fix lint

* Merge functions, make overload private

* Handle some edge cases better (nodes in differing files than current emit)

* Account for transformed nodes
2018-05-10 11:16:27 -07:00

10 lines
225 B
TypeScript

// @declaration: true
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;
}