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.
-> DsM (Type, MatchResult)
dsGRHSs kind pats (GRHSs grhss binds ty)
- = mapDs (dsGRHS kind pats) grhss `thenDs` \ match_results ->
+ = mappM (dsGRHS kind pats) grhss `thenDs` \ match_results ->
let
match_result1 = foldr1 combineMatchResults match_results
match_result2 = adjustMatchResultDs (dsLet binds) match_result1
-- 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