Commit 67e7de3d authored by simonpj's avatar simonpj
Browse files

[project @ 2005-08-18 10:02:54 by simonpj]

Make the forkM failure fail more tidily.  Interface-file inconsistencies
give rise to failures in the IfM monad.  An error message is printed, but
up to now we've also said "The impossible happened, must be a GHC bug".
That's not true, though, it could just be messed up interface files.

So this commit still makes the compiler halt, but in a tidier, less
self-accusatory way.

Still to come: when original names in interface files mention the
package Id too, the error will become clearer still.

	MERGE to STABLE
parent fc0c93a9
...@@ -206,7 +206,7 @@ loadInterface doc_str mod from ...@@ -206,7 +206,7 @@ loadInterface doc_str mod from
| otherwise -> | otherwise ->
let let
loc_doc = text file_path <+> colon loc_doc = text file_path
in in
initIfaceLcl mod loc_doc $ do initIfaceLcl mod loc_doc $ do
......
...@@ -931,7 +931,7 @@ failIfM :: Message -> IfL a ...@@ -931,7 +931,7 @@ failIfM :: Message -> IfL a
-- We use IfL here so that we can get context info out of the local env -- We use IfL here so that we can get context info out of the local env
failIfM msg failIfM msg
= do { env <- getLclEnv = do { env <- getLclEnv
; let full_msg = if_loc env $$ nest 2 msg ; let full_msg = (if_loc env <> colon) $$ nest 2 msg
; ioToIOEnv (printErrs (full_msg defaultErrStyle)) ; ioToIOEnv (printErrs (full_msg defaultErrStyle))
; failM } ; failM }
...@@ -971,7 +971,8 @@ forkM :: SDoc -> IfL a -> IfL a ...@@ -971,7 +971,8 @@ forkM :: SDoc -> IfL a -> IfL a
forkM doc thing_inside forkM doc thing_inside
= do { mb_res <- forkM_maybe doc thing_inside = do { mb_res <- forkM_maybe doc thing_inside
; return (case mb_res of ; return (case mb_res of
Nothing -> pprPanic "forkM" doc Nothing -> pgmError "Cannot continue after interface file error"
-- pprPanic "forkM" doc
Just r -> r) } Just r -> r) }
\end{code} \end{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment