Fix prefix operator pattern-match invalid result

remotes/felixonmars/release
Lennart Spitzner 2019-09-03 00:23:58 +02:00
parent 8861f16624
commit 702b993dab
2 changed files with 5 additions and 1 deletions

View File

@ -668,3 +668,7 @@ nand _ _ = True
nor False False = True nor False False = True
_ `nor` _ = False _ `nor` _ = False
#test issue 256 prefix operator match
f ((:) a as) = undefined

View File

@ -86,7 +86,7 @@ layoutPat (ghcDL -> lpat@(L _ pat)) = docWrapNode lpat $ case pat of
-- return $ (x1' Seq.<| middle) Seq.|> xN' -- return $ (x1' Seq.<| middle) Seq.|> xN'
ConPatIn lname (PrefixCon args) -> do ConPatIn lname (PrefixCon args) -> do
-- Abc a b c -> expr -- Abc a b c -> expr
let nameDoc = lrdrNameToText lname nameDoc <- lrdrNameToTextAnn lname
argDocs <- layoutPat `mapM` args argDocs <- layoutPat `mapM` args
if null argDocs if null argDocs
then return <$> docLit nameDoc then return <$> docLit nameDoc