Print TypeParameter even when unary function type (#2406)
parent
7c4a8d07a0
commit
86c88ff278
|
@ -3039,6 +3039,7 @@ function printFunctionParams(path, print, options, expandArg, printTypeParams) {
|
||||||
fun[paramsField].length === 1 &&
|
fun[paramsField].length === 1 &&
|
||||||
fun[paramsField][0].name === null &&
|
fun[paramsField][0].name === null &&
|
||||||
fun[paramsField][0].typeAnnotation &&
|
fun[paramsField][0].typeAnnotation &&
|
||||||
|
fun.typeParameters === null &&
|
||||||
flowTypeAnnotations.indexOf(fun[paramsField][0].typeAnnotation.type) !==
|
flowTypeAnnotations.indexOf(fun[paramsField][0].typeAnnotation.type) !==
|
||||||
-1 &&
|
-1 &&
|
||||||
!(
|
!(
|
||||||
|
|
|
@ -156,6 +156,24 @@ type State = {
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`type.js 1`] = `
|
||||||
|
type F = <T>(T) => T;
|
||||||
|
type G = (<A, B>(A) => B);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
type F = <T>(T) => T;
|
||||||
|
type G = <A, B>(A) => B;
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`type.js 2`] = `
|
||||||
|
type F = <T>(T) => T;
|
||||||
|
type G = (<A, B>(A) => B);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
type F = <T>(T) => T;
|
||||||
|
type G = <A, B>(A) => B;
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`union.js 1`] = `
|
exports[`union.js 1`] = `
|
||||||
type Foo = Promise<
|
type Foo = Promise<
|
||||||
{ ok: true, bar: string, baz: SomeOtherLongType } |
|
{ ok: true, bar: string, baz: SomeOtherLongType } |
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
type F = <T>(T) => T;
|
||||||
|
type G = (<A, B>(A) => B);
|
Loading…
Reference in New Issue