Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
GHC
Commits
6cea635a
Commit
6cea635a
authored
27 years ago
by
Simon Peyton Jones
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-01-29 12:46:11 by simonpj]
Fix interaction of "hiding" on import with "module M" on export
parent
9e999371
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghc/compiler/rename/RnEnv.lhs
+22
-9
22 additions, 9 deletions
ghc/compiler/rename/RnEnv.lhs
ghc/compiler/rename/RnNames.lhs
+1
-1
1 addition, 1 deletion
ghc/compiler/rename/RnNames.lhs
with
23 additions
and
10 deletions
ghc/compiler/rename/RnEnv.lhs
+
22
−
9
View file @
6cea635a
...
...
@@ -484,16 +484,29 @@ pprFixityProvenance (fixity, how_in_scope) = ppr how_in_scope
=============== Avails ================
===============
Export
Avails ================
\begin{code}
mkExportAvails ::
Bool -> Module
-> [AvailInfo] -> ExportAvails
mkExportAvails
unqualified_import mod_name
avails
mkExportAvails ::
Module -> Bool -> GlobalNameEnv
-> [AvailInfo] -> ExportAvails
mkExportAvails
mod_name unqual_imp name_env
avails
= (mod_avail_env, entity_avail_env)
where
-- The "module M" syntax only applies to *unqualified* imports (1.4 Report, Section 5.1.1)
mod_avail_env | unqualified_import = unitFM mod_name avails
| otherwise = emptyFM
mod_avail_env = unitFM mod_name unqual_avails
-- unqual_avails is the Avails that are visible in *unqualfied* form
-- (1.4 Report, Section 5.1.1)
-- For example, in
-- import T hiding( f )
-- we delete f from avails
unqual_avails | not unqual_imp = [] -- Short cut when no unqualified imports
| otherwise = [prune avail | avail <- avails]
prune (Avail n) | unqual_in_scope n = Avail n
prune (Avail n) | otherwise = NotAvailable
prune (AvailTC n ns) = AvailTC n (filter unqual_in_scope ns)
unqual_in_scope n = Unqual (nameOccName n) `elemFM` name_env
entity_avail_env = listToUFM [ (name,avail) | avail <- avails,
name <- availEntityNames avail]
...
...
@@ -556,8 +569,8 @@ filterAvail ie@(IEThingWith want wants) avail@(AvailTC n ns)
avail_occs = map nameOccName ns
wanted_occs = map rdrNameOcc (want:wants)
filterAvail (IEThingAbs _) (AvailTC n ns)
| n `elem` ns =
AvailTC n [n]
filterAvail (IEThingAbs _) (AvailTC n ns)
= ASSERT( n `elem` ns )
AvailTC n [n]
filterAvail (IEThingAbs _) avail@(Avail n) = avail -- Type synonyms
...
...
This diff is collapsed.
Click to expand it.
ghc/compiler/rename/RnNames.lhs
+
1
−
1
View file @
6cea635a
...
...
@@ -313,7 +313,7 @@ qualifyImports this_mod qual_imp unqual_imp as_mod hides
fixity_env = foldl (add_fixity name_env2) emptyFixityEnv fixities
-- Create the export-availability info
export_avails = mkExportAvails
un
qual_
imp qual_mod
avails
export_avails = mkExportAvails qual_
mod unqual_imp name_env2
avails
in
returnRn (RnEnv name_env2 fixity_env, export_avails)
where
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment