Fix: Union type with type params regression (#2688)

master
James Henry 2017-08-29 02:37:12 +01:00 committed by Christopher Chedeau
parent 8bb8eaf941
commit 987b931215
3 changed files with 33 additions and 0 deletions

View File

@ -2163,6 +2163,7 @@ function genericPrintNoParens(path, options, print, args) {
const shouldIndent =
parent.type !== "TypeParameterInstantiation" &&
parent.type !== "GenericTypeAnnotation" &&
parent.type !== "TSTypeReference" &&
!(
(parent.type === "TypeAlias" ||
parent.type === "VariableDeclarator") &&

View File

@ -134,3 +134,26 @@ interface Interface {
}
`;
exports[`with-type-params.ts 1`] = `
type GetChatsSagaEffects =
| CallEffect
| PutEffect<
| GetUsersRequestedAction
| GetChatsSucceededAction
| GetChatsFailedAction
| GetChatsStartedAction
>
| SelectEffect
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type GetChatsSagaEffects =
| CallEffect
| PutEffect<
| GetUsersRequestedAction
| GetChatsSucceededAction
| GetChatsFailedAction
| GetChatsStartedAction
>
| SelectEffect;
`;

View File

@ -0,0 +1,9 @@
type GetChatsSagaEffects =
| CallEffect
| PutEffect<
| GetUsersRequestedAction
| GetChatsSucceededAction
| GetChatsFailedAction
| GetChatsStartedAction
>
| SelectEffect