projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ab4bc0f
)
Fix TH erorr recovery (test is TH_recover)
author
simonpj@microsoft.com
<unknown>
Fri, 14 Apr 2006 12:04:11 +0000
(12:04 +0000)
committer
simonpj@microsoft.com
<unknown>
Fri, 14 Apr 2006 12:04:11 +0000
(12:04 +0000)
compiler/typecheck/TcSplice.lhs
patch
|
blob
|
history
diff --git
a/compiler/typecheck/TcSplice.lhs
b/compiler/typecheck/TcSplice.lhs
index
2215c9b
..
7c3aa86
100644
(file)
--- a/
compiler/typecheck/TcSplice.lhs
+++ b/
compiler/typecheck/TcSplice.lhs
@@
-421,7
+421,16
@@
instance TH.Quasi (IOEnv (Env TcGblEnv TcLclEnv)) where
qCurrentModule = do { m <- getModule; return (moduleString m) }
qReify v = reify v
qCurrentModule = do { m <- getModule; return (moduleString m) }
qReify v = reify v
- qRecover = recoverM
+
+ -- For qRecover, discard error messages if
+ -- the recovery action is chosen. Otherwise
+ -- we'll only fail higher up. c.f. tryTcLIE_
+ qRecover recover main = do { (msgs, mb_res) <- tryTcErrs main
+ ; case mb_res of
+ Just val -> do { addMessages msgs -- There might be warnings
+ ; return val }
+ Nothing -> recover -- Discard all msgs
+ }
qRunIO io = ioToTcRn io
\end{code}
qRunIO io = ioToTcRn io
\end{code}