summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore/Utils.hs
diff options
context:
space:
mode:
authorCale Gibbard <cgibbard@gmail.com>2020-06-30 10:46:49 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-07 08:34:46 -0400
commitfa9bb70a3fefef681cb0e80cc78977386c1dcf0a (patch)
tree09c9f9f42540f75b5098ed47a28a09bb07ee19a2 /compiler/GHC/HsToCore/Utils.hs
parent3907ee01e68b383fa30386d163decf203acedb19 (diff)
downloadhaskell-fa9bb70a3fefef681cb0e80cc78977386c1dcf0a.tar.gz
Add some tests for fail messages in do-expressions and monad-comprehensions.
Diffstat (limited to 'compiler/GHC/HsToCore/Utils.hs')
-rw-r--r--compiler/GHC/HsToCore/Utils.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/HsToCore/Utils.hs b/compiler/GHC/HsToCore/Utils.hs
index b9644e4444..1b0face052 100644
--- a/compiler/GHC/HsToCore/Utils.hs
+++ b/compiler/GHC/HsToCore/Utils.hs
@@ -898,7 +898,7 @@ CPR-friendly. This matters a lot: if you don't get it right, you lose
the tail call property. For example, see #3403.
-}
-dsHandleMonadicFailure :: HsStmtContext GhcTc -> LPat GhcTc -> MatchResult CoreExpr -> FailOperator GhcTc -> DsM CoreExpr
+dsHandleMonadicFailure :: Outputable (IdP p) => HsStmtContext p -> LPat GhcTc -> MatchResult CoreExpr -> FailOperator GhcTc -> DsM CoreExpr
-- In a do expression, pattern-match failure just calls
-- the monadic 'fail' rather than throwing an exception
dsHandleMonadicFailure ctx pat match m_fail_op =
@@ -919,7 +919,7 @@ dsHandleMonadicFailure ctx pat match m_fail_op =
fail_expr <- dsSyntaxExpr fail_op [fail_msg]
body fail_expr
-mk_fail_msg :: DynFlags -> HsStmtContext GhcTc -> Located e -> String
+mk_fail_msg :: Outputable (IdP p) => DynFlags -> HsStmtContext p -> Located e -> String
mk_fail_msg dflags ctx pat = showPpr dflags $ text "Pattern match failure in" <+> pprStmtContext ctx <+> text "at" <+> ppr (getLoc pat)
{- *********************************************************************