Simon Hengel pushed to branch wip/sol/hie-wierd-in-as-external at Glasgow Haskell Compiler / GHC Commits: 9815908e by Simon Hengel at 2025-07-30T11:43:53+07:00 Use isKnownOrigName_maybe to reconstruct wired-in names - - - - - 9909605a by Simon Hengel at 2025-07-30T11:43:53+07:00 Rely on knownKeysOrigNameCache - - - - - 2 changed files: - compiler/GHC/Types/Name/Cache.hs - testsuite/tests/hiefile/should_run/TestUtils.hs Changes: ===================================== compiler/GHC/Types/Name/Cache.hs ===================================== @@ -100,9 +100,14 @@ OrigNameCache at all? Good question; after all, 3) Loading of interface files encodes names via Uniques, as detailed in Note [Symbol table representation of names] in GHC.Iface.Binary -It turns out that we end up looking up built-in syntax in the cache when we -generate Haddock documentation. E.g. if we don't find tuple data constructors -there, hyperlinks won't work as expected. Test case: haddockHtmlTest (Bug923.hs) + +However note that: + 1) It turns out that we end up looking up built-in syntax in the cache when + we generate Haddock documentation. E.g. if we don't find tuple data + constructors there, hyperlinks won't work as expected. Test case: + haddockHtmlTest (Bug923.hs) + 2) HIE de-serialization relies on built-in names being present in the + knownKeysOrigNameCache. -} -- | The NameCache makes sure that there is just one Unique assigned for ===================================== testsuite/tests/hiefile/should_run/TestUtils.hs ===================================== @@ -25,9 +25,6 @@ import GHC.Iface.Ext.Utils import GHC.Driver.Session import GHC.SysTools -makeNc :: IO NameCache -makeNc = initNameCache 'z' [] - dynFlagsForPrinting :: String -> IO DynFlags dynFlagsForPrinting libdir = do systemSettings <- initSysTools libdir @@ -37,7 +34,7 @@ readTestHie :: FilePath -> IO (DynFlags, HieFile) readTestHie fp = do libdir:_ <- getArgs df <- dynFlagsForPrinting libdir - nc <- makeNc + nc <- newNameCache 'r' knownKeysOrigNameCache hfr <- readHieFile nc fp pure (df, hie_file_result hfr) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/330d46a1e9414c37cc0460c4de123c4... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/330d46a1e9414c37cc0460c4de123c4... You're receiving this email because of your account on gitlab.haskell.org.