summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsGRHSs.hs
diff options
context:
space:
mode:
authorHE, Tao <sighingnow@gmail.com>2018-03-02 14:16:24 -0500
committerBen Gamari <ben@smart-cactus.org>2018-03-02 14:52:10 -0500
commite8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a (patch)
tree2ce712a6b9c00bf2d1e969bbb1db28a8858a14c7 /compiler/deSugar/DsGRHSs.hs
parent8c7a1551fcd004c37f4ccd99c7c10395179519f1 (diff)
downloadhaskell-e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a.tar.gz
Improve exhaustive checking for guards in pattern bindings and MultiIf.
Previously we didn't do exhaustive checking on MultiIf expressions and guards in pattern bindings. We can construct the `LMatch` directly from GRHSs or [LHsExpr] (MultiIf's alts) then feed it to checkMatches, without construct the MatchGroup and using function `matchWrapper`. Signed-off-by: HE, Tao <sighingnow@gmail.com> Test Plan: make test TEST="T14773a T14773b" Reviewers: bgamari, RyanGlScott, simonpj Reviewed By: bgamari, simonpj Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14773 Differential Revision: https://phabricator.haskell.org/D4400
Diffstat (limited to 'compiler/deSugar/DsGRHSs.hs')
-rw-r--r--compiler/deSugar/DsGRHSs.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/deSugar/DsGRHSs.hs b/compiler/deSugar/DsGRHSs.hs
index d521f537e5..e4127ad97f 100644
--- a/compiler/deSugar/DsGRHSs.hs
+++ b/compiler/deSugar/DsGRHSs.hs
@@ -33,7 +33,7 @@ import SrcLoc
import Outputable
{-
-@dsGuarded@ is used for both @case@ expressions and pattern bindings.
+@dsGuarded@ is used for pattern bindings.
It desugars:
\begin{verbatim}
| g1 -> e1
@@ -46,7 +46,6 @@ necessary. The type argument gives the type of the @ei@.
-}
dsGuarded :: GRHSs GhcTc (LHsExpr GhcTc) -> Type -> DsM CoreExpr
-
dsGuarded grhss rhs_ty = do
match_result <- dsGRHSs PatBindRhs grhss rhs_ty
error_expr <- mkErrorAppDs nON_EXHAUSTIVE_GUARDS_ERROR_ID rhs_ty empty