From 72d086106d49bc18277f3a066e671e87e9b37a1b Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Thu, 7 May 2020 18:03:36 +0200 Subject: Refactor homeUnit * rename thisPackage into homeUnit * document and refactor several Backpack things --- compiler/GHC/CoreToStg/Prep.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/GHC/CoreToStg/Prep.hs') diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs index 7420475813..cc408ca46f 100644 --- a/compiler/GHC/CoreToStg/Prep.hs +++ b/compiler/GHC/CoreToStg/Prep.hs @@ -1556,9 +1556,9 @@ lookupNaturalSDataConName dflags hsc_env = case integerLibrary dflags of -- | Helper for 'lookupMkIntegerName', 'lookupIntegerSDataConName' guardIntegerUse :: DynFlags -> IO a -> IO a guardIntegerUse dflags act - | thisPackage dflags == primUnitId + | homeUnit dflags == primUnitId = return $ panic "Can't use Integer in ghc-prim" - | thisPackage dflags == integerUnitId + | homeUnit dflags == integerUnitId = return $ panic "Can't use Integer in integer-*" | otherwise = act @@ -1568,11 +1568,11 @@ guardIntegerUse dflags act -- literals in `base`. If we do, we get interface loading error for GHC.Natural. guardNaturalUse :: DynFlags -> IO a -> IO a guardNaturalUse dflags act - | thisPackage dflags == primUnitId + | homeUnit dflags == primUnitId = return $ panic "Can't use Natural in ghc-prim" - | thisPackage dflags == integerUnitId + | homeUnit dflags == integerUnitId = return $ panic "Can't use Natural in integer-*" - | thisPackage dflags == baseUnitId + | homeUnit dflags == baseUnitId = return $ panic "Can't use Natural in base" | otherwise = act -- cgit v1.2.1