Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Tobias Decking
GHC
Commits
97958a39
Commit
97958a39
authored
Feb 20, 2003
by
simonpj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2003-02-20 13:18:10 by simonpj]
Part 2 of fix :i in InteractiveUI
parent
f6176af6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
18 deletions
+29
-18
ghc/compiler/typecheck/TcRnDriver.lhs
ghc/compiler/typecheck/TcRnDriver.lhs
+29
-18
No files found.
ghc/compiler/typecheck/TcRnDriver.lhs
View file @
97958a39
...
...
@@ -478,24 +478,28 @@ tcRnThing hsc_env pcs ictxt rdr_name
-- constructor and type class identifiers.
let { rdr_names = dataTcOccs rdr_name } ;
(msgs_s, mb_names) <- initRnInteractive ictxt
(mapAndUnzipM (tryTc . lookupOccRn) rdr_names) ;
let { names = catMaybes mb_names } ;
if null names then
do { addMessages (head msgs_s) ; failM }
else do {
-- Add deprecation warnings
mapM_ addMessages msgs_s ;
-- results :: [(Messages, Maybe Name)]
results <- initRnInteractive ictxt
(mapM (tryTc . lookupOccRn) rdr_names) ;
-- The successful lookups will be (Just name)
let { (warns_s, good_names) = unzip [ (msgs, name)
| (msgs, Just name) <- results] ;
errs_s = [msgs | (msgs, Nothing) <- results] } ;
-- Fail if nothing good happened, else add warnings
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
tcg_env <- importSupportingDecls (mkFVs names) ;
tcg_env <- importSupportingDecls (mkFVs
good_
names) ;
setGblEnv tcg_env $ do {
-- And lookup up the entities
mapM tcLookupGlobal names
}}
}
mapM tcLookupGlobal
good_
names
}}
\end{code}
...
...
@@ -543,10 +547,17 @@ tcRnExtCore hsc_env pcs
(rnSrcDecls local_group) ;
failIfErrsM ;
-- Get the supporting decls, and typecheck them all together
-- so that any mutually recursive types are done right
extra_decls <- slurpImpDecls fvs ;
tcg_env <- typecheckIfaceDecls (rn_local_decls `addImpDecls` extra_decls) ;
-- Get the supporting decls
rn_imp_decls <- slurpImpDecls fvs ;
let { rn_decls = rn_local_decls `addImpDecls` rn_imp_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 {
-- Now the core bindings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment