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.
-- 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