summaryrefslogtreecommitdiff
path: root/compiler/GHC/Hs
diff options
context:
space:
mode:
authorJakob Bruenker <jakob.bruenker@gmail.com>2022-03-29 18:56:50 +0200
committerMatthew Pickering <matthewtpickering@gmail.com>2022-04-01 11:08:28 +0100
commitdf65d732d6a39e6d0a7886dc5faa265caece3ce0 (patch)
tree4eef88396dad109f0b25308793c36c575942b669 /compiler/GHC/Hs
parent265477593865f436fe97c903cc20d7d448a66b79 (diff)
downloadhaskell-df65d732d6a39e6d0a7886dc5faa265caece3ce0.tar.gz
Fix panic when pretty printing HsCmdLam
When pretty printing a HsCmdLam with more than one argument, GHC panicked because of a missing case. This fixes that. Closes #21300
Diffstat (limited to 'compiler/GHC/Hs')
-rw-r--r--compiler/GHC/Hs/Expr.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs
index accdd189ec..e4ce67d5cf 100644
--- a/compiler/GHC/Hs/Expr.hs
+++ b/compiler/GHC/Hs/Expr.hs
@@ -1406,6 +1406,10 @@ pprMatch (Match { m_pats = pats, m_ctxt = ctxt, m_grhss = grhss })
LambdaExpr -> (char '\\', pats)
+ ArrowMatchCtxt KappaExpr -> (char '\\', pats)
+
+ ArrowMatchCtxt ProcExpr -> (text "proc", pats)
+
_ -> case pats of
[] -> (empty, [])
[pat] -> (ppr pat, []) -- No parens around the single pat in a case