summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/simplCore/CoreMonad.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/simplCore/CoreMonad.hs b/compiler/simplCore/CoreMonad.hs
index 912ff9949c..683fb0434d 100644
--- a/compiler/simplCore/CoreMonad.hs
+++ b/compiler/simplCore/CoreMonad.hs
@@ -67,6 +67,7 @@ import Annotations
import IOEnv hiding ( liftIO, failM, failWithM )
import qualified IOEnv ( liftIO )
+import IfaceEnv ( lookupOrigIO )
import TcEnv ( lookupGlobal )
import Var
import Outputable
@@ -821,6 +822,6 @@ thNameToGhcName th_name
| Just n <- isExact_maybe rdr_name -- This happens in derived code
= return $ if isExternalName n then Just n else Nothing
| Just (rdr_mod, rdr_occ) <- isOrig_maybe rdr_name
- = do { cache <- getOrigNameCache
- ; return $ lookupOrigNameCache cache rdr_mod rdr_occ }
+ = do { hsc_env <- getHscEnv
+ ; Just <$> liftIO (lookupOrigIO hsc_env rdr_mod rdr_occ) }
| otherwise = return Nothing