Print TypeParameter even when unary function type (#2406)

This commit is contained in:
Dan Wang authored and Lucas Azzola committed 2017-07-06 19:13:30 +10:00
1 parent 7c4a8d07a0
commit 86c88ff278
3 files changed
+21

No files matched your search

+1
View File
@@ -3039,6 +3039,7 @@ function printFunctionParams(path, print, options, expandArg, printTypeParams) {
fun[paramsField].length === 1 &&
fun[paramsField][0].name === null &&
fun[paramsField][0].typeAnnotation &&
fun.typeParameters === null &&
flowTypeAnnotations.indexOf(fun[paramsField][0].typeAnnotation.type) !==
-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`] = `
type Foo = Promise<
{ ok: true, bar: string, baz: SomeOtherLongType } |
+2
View File
@@ -0,0 +1,2 @@
type F = <T>(T) => T;
type G = (<A, B>(A) => B);