X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FdeSugar%2FDsGRHSs.lhs;h=0aef3a6e4ded048a09524efaecb5f13c373d82e3;hb=fa6b1e4523a9d8a1fe85a95e5c69e767746cbe7d;hp=0e562e5374857fa1f3ff8957a10faa9ac93dc2be;hpb=ab46fd8e68f10b6162e77cfc0b216510d9b1d933;p=ghc-hetmet.git diff --git a/ghc/compiler/deSugar/DsGRHSs.lhs b/ghc/compiler/deSugar/DsGRHSs.lhs index 0e562e5..0aef3a6 100644 --- a/ghc/compiler/deSugar/DsGRHSs.lhs +++ b/ghc/compiler/deSugar/DsGRHSs.lhs @@ -18,8 +18,10 @@ import Type ( Type ) import DsMonad import DsUtils +import Unique ( Uniquable(..) ) import PrelInfo ( nON_EXHAUSTIVE_GUARDS_ERROR_ID ) -import PrelNames ( otherwiseIdKey, trueDataConKey, hasKey ) +import TysWiredIn ( trueDataConId ) +import PrelNames ( otherwiseIdKey, hasKey ) \end{code} @dsGuarded@ is used for both @case@ expressions and pattern bindings. @@ -74,7 +76,7 @@ matchGuard :: [TypecheckedStmt] -- Guard -> DsMatchContext -- Context -> DsM MatchResult --- See comments with HsExpr.HsStmt re what an ExprStmt means +-- See comments with HsExpr.Stmt re what an ExprStmt means -- Here we must be in a guard context (not do-expression, nor list-comp) matchGuard [ResultStmt expr locn] ctx @@ -85,7 +87,9 @@ matchGuard [ResultStmt expr locn] ctx -- Turn an "otherwise" guard is a no-op matchGuard (ExprStmt (HsVar v) _ _ : stmts) ctx | v `hasKey` otherwiseIdKey - || v `hasKey` trueDataConKey + || v `hasKey` getUnique trueDataConId + -- trueDataConId doesn't have the same + -- unique as trueDataCon = matchGuard stmts ctx matchGuard (ExprStmt expr _ locn : stmts) ctx