fix TSFunctionType failing on TypeParameters (#1394)
parent
44e55f7fa7
commit
5f5566e4ef
|
@ -1632,7 +1632,13 @@ function genericPrintNoParens(path, options, print, args) {
|
|||
parts.push("(");
|
||||
}
|
||||
|
||||
parts.push(path.call(print, "typeParameters"));
|
||||
if (n.typeParameters && n.typeParameters.length) {
|
||||
parts.push(
|
||||
"<",
|
||||
join(", ", path.map(print, "typeParameters")),
|
||||
">"
|
||||
)
|
||||
}
|
||||
|
||||
parts.push(printFunctionParams(path, print, options));
|
||||
|
||||
|
|
|
@ -565,6 +565,13 @@ function fn5() {}
|
|||
|
||||
`;
|
||||
|
||||
exports[`functionTypeTypeParameters.ts 1`] = `
|
||||
type FuncWithTypeParameter = <T, P>() => {};
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
type FuncWithTypeParameter = <T, P>() => {};
|
||||
|
||||
`;
|
||||
|
||||
exports[`parameterInitializersForwardReferencing.ts 1`] = `
|
||||
function left(a, b = a, c = b) {
|
||||
a;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
type FuncWithTypeParameter = <T, P>() => {};
|
Loading…
Reference in New Issue