[project @ 1999-01-19 11:39:44 by sof]
authorsof <unknown>
Tue, 19 Jan 1999 11:39:44 +0000 (11:39 +0000)
committersof <unknown>
Tue, 19 Jan 1999 11:39:44 +0000 (11:39 +0000)
mkExportAvails: remove NotAvailable entries corresponding
to 'hidden' entities from 'unqual_avails'. Not needed and
leaving them in causes bother later on in the renamer.

This fixes the problem of compiling

   module B ( module A ) where { import A hiding ( a ) }

Regression test added to check for this - will commit soon.

ghc/compiler/rename/RnEnv.lhs

index a1c404f..6114665 100644 (file)
@@ -542,7 +542,12 @@ mkExportAvails mod_name unqual_imp name_env avails
        -- we delete f from avails
 
     unqual_avails | not unqual_imp = []        -- Short cut when no unqualified imports
-                 | otherwise      = [prune avail | avail <- avails]
+                 | otherwise      = [ avail' | avail  <- avails 
+                                             , let avail' = prune avail
+                                             , case avail' of
+                                                 NotAvailable -> False
+                                                 _            -> True
+                                             ]
 
     prune (Avail n) | unqual_in_scope n = Avail n
     prune (Avail n) | otherwise                = NotAvailable