cleanTempDirs )
import Module
import UniqFM
+import UniqSet
+import Unique
import PackageConfig
import FiniteMap
import Panic
-- we have to implement the shadowing behaviour of ic_tmp_ids here
-- (see InteractiveContext) and the quickest way is to use an OccEnv.
let
- tmp_ids = reverse (ic_tmp_ids (hsc_IC hsc_env))
- env = mkOccEnv [ (nameOccName (idName id), id) | id <- tmp_ids ]
+ tmp_ids = ic_tmp_ids (hsc_IC hsc_env)
+ filtered = foldr f (const []) tmp_ids emptyUniqSet
+ f id rest set
+ | uniq `elementOfUniqSet` set = rest set
+ | otherwise = AnId id : rest (addOneToUniqSet set uniq)
+ where uniq = getUnique (nameOccName (idName id))
in
- return (map AnId (occEnvElts env))
+ return filtered
getPrintUnqual :: Session -> IO PrintUnqualified
getPrintUnqual s = withSession s (return . icPrintUnqual . hsc_IC)