Fix interaction of do-block with ExprWithTySig

ghc92
Lennart Spitzner 2023-06-21 11:24:12 +02:00
parent 628ab81bc9
commit 9d14407191
2 changed files with 12 additions and 1 deletions

View File

@ -1101,3 +1101,10 @@ func = do
}
)
anotherArgument
#test yet another invalid do-block operator alignment
func = do
it "some long description does not matter" $ do
some long function invocation (plus a paren + ed operator expression)
`shouldReturn` all ((==) True)
:: IO ()

View File

@ -850,7 +850,11 @@ layoutExpr lexpr@(L _ expr) = do
ExprWithTySig _ exp1 (HsWC _ typ1) -> do
expDoc <- shareDoc $ callLayouter layout_expr exp1
typDoc <- shareDoc $ callLayouter layout_sigType typ1
docSeq [appSep expDoc, appSep $ docLit $ Text.pack "::", typDoc]
docAlt
[ docForceSingleline
$ docSeq [appSep expDoc, appSep $ docLitS "::", typDoc]
, docPar expDoc (docSeq [docLitS "::", docSeparator, typDoc])
]
ArithSeq _ Nothing info -> case info of
From e1 -> do
e1Doc <- shareDoc $ layoutExpr e1