Commit 97958a39 authored by simonpj's avatar simonpj

[project @ 2003-02-20 13:18:10 by simonpj]

Part 2 of fix :i in InteractiveUI
parent f6176af6
...@@ -478,24 +478,28 @@ tcRnThing hsc_env pcs ictxt rdr_name ...@@ -478,24 +478,28 @@ tcRnThing hsc_env pcs ictxt rdr_name
-- constructor and type class identifiers. -- constructor and type class identifiers.
let { rdr_names = dataTcOccs rdr_name } ; let { rdr_names = dataTcOccs rdr_name } ;
(msgs_s, mb_names) <- initRnInteractive ictxt -- results :: [(Messages, Maybe Name)]
(mapAndUnzipM (tryTc . lookupOccRn) rdr_names) ; results <- initRnInteractive ictxt
let { names = catMaybes mb_names } ; (mapM (tryTc . lookupOccRn) rdr_names) ;
if null names then -- The successful lookups will be (Just name)
do { addMessages (head msgs_s) ; failM } let { (warns_s, good_names) = unzip [ (msgs, name)
else do { | (msgs, Just name) <- results] ;
errs_s = [msgs | (msgs, Nothing) <- results] } ;
-- Add deprecation warnings -- Fail if nothing good happened, else add warnings
mapM_ addMessages msgs_s ; if null good_names then -- Fail
do { addMessages (head errs_s) ; failM }
else -- Add deprecation warnings
mapM_ addMessages warns_s ;
-- Slurp in the supporting declarations -- Slurp in the supporting declarations
tcg_env <- importSupportingDecls (mkFVs names) ; tcg_env <- importSupportingDecls (mkFVs good_names) ;
setGblEnv tcg_env $ do { setGblEnv tcg_env $ do {
-- And lookup up the entities -- And lookup up the entities
mapM tcLookupGlobal names mapM tcLookupGlobal good_names
}}} }}
\end{code} \end{code}
...@@ -543,10 +547,17 @@ tcRnExtCore hsc_env pcs ...@@ -543,10 +547,17 @@ tcRnExtCore hsc_env pcs
(rnSrcDecls local_group) ; (rnSrcDecls local_group) ;
failIfErrsM ; failIfErrsM ;
-- Get the supporting decls, and typecheck them all together -- Get the supporting decls
-- so that any mutually recursive types are done right rn_imp_decls <- slurpImpDecls fvs ;
extra_decls <- slurpImpDecls fvs ; let { rn_decls = rn_local_decls `addImpDecls` rn_imp_decls } ;
tcg_env <- typecheckIfaceDecls (rn_local_decls `addImpDecls` extra_decls) ;
-- Dump trace of renaming part
rnDump (ppr rn_decls) ;
rnStats rn_imp_decls ;
-- Typecheck them all together so that
-- any mutually recursive types are done right
tcg_env <- typecheckIfaceDecls rn_decls ;
setGblEnv tcg_env $ do { setGblEnv tcg_env $ do {
-- Now the core bindings -- Now the core bindings
......
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