projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Trac #2111: improve error handling for 'rec' in do-notation
[ghc-hetmet.git]
/
compiler
/
typecheck
/
TcMatches.lhs
diff --git
a/compiler/typecheck/TcMatches.lhs
b/compiler/typecheck/TcMatches.lhs
index
f02b74a
..
452bae7
100644
(file)
--- a/
compiler/typecheck/TcMatches.lhs
+++ b/
compiler/typecheck/TcMatches.lhs
@@
-509,6
+509,11
@@
tcDoStmt ctxt (ExprStmt rhs then_op _) (reft,res_ty) thing_inside
; thing <- thing_inside (reft, new_res_ty)
; return (ExprStmt rhs' then_op' rhs_ty, thing) }
; thing <- thing_inside (reft, new_res_ty)
; return (ExprStmt rhs' then_op' rhs_ty, thing) }
+tcDoStmt ctxt (RecStmt {}) res_ty thing_inside
+ = failWithTc (ptext SLIT("Illegal 'rec' stmt in") <+> pprStmtContext ctxt)
+ -- This case can't be caught in the renamer
+ -- see RnExpr.checkRecStmt
+
tcDoStmt ctxt stmt res_ty thing_inside
= pprPanic "tcDoStmt: unexpected Stmt" (ppr stmt)
tcDoStmt ctxt stmt res_ty thing_inside
= pprPanic "tcDoStmt: unexpected Stmt" (ppr stmt)