TypeScript/tests/cases/compiler/importTypeGenericArrowTypeParenthesized.ts
Wesley Wigham d7f03fb0fa
Parse generic function types in import type argument lists (#31079)
* Parenthesize in import type node factory

* And now parse unparenthesized generic functions so we can handle parsing the older output
2019-04-23 14:48:31 -07:00

19 lines
463 B
TypeScript

// @declaration: true
// @filename: module.d.ts
declare module "module" {
export interface Modifier<T> { }
export function fn<T>(x: T): Modifier<T>;
}
// @filename: index.ts
import { fn } from "module";
export const fail1 = fn(<T>(x: T): T => x);
export const fail2 = fn(function<T>(x: T): T {
return x;
});
export const works1 = fn((x: number) => x);
type MakeItWork = <T>(x: T) => T;
export const works2 = fn<MakeItWork>(x => x);