@@ -53,7 +53,8 @@ import Development.IDE.GHC.Compat
5353import Development.IDE.GHC.Compat.Util (Fingerprint )
5454import qualified Development.IDE.GHC.Compat.Util as Util
5555import Development.IDE.GHC.Orphans ()
56- import Development.IDE.Import.FindImports (ArtifactsLocation (.. ))
56+ import Development.IDE.Import.FindImports (ArtifactsLocation (.. ),
57+ isBootLocation )
5758import Development.IDE.Types.Diagnostics
5859import Development.IDE.Types.Location
5960import GHC.Generics (Generic )
@@ -273,7 +274,17 @@ processDependencyInformation RawDependencyInformation{..} rawBootMap mg shallowF
273274 foldr (\ (p, cs) res ->
274275 let new = IntMap. fromList (map (, IntSet. singleton (coerce p)) (coerce cs))
275276 in IntMap. unionWith IntSet. union new res ) IntMap. empty successEdges
276- reverseModuleMap = mkModuleEnv $ map (\ (i,sm) -> (showableModule sm, FilePathId i)) $ IntMap. toList rawModuleMap
277+ -- Map 'Module' to 'FilePathId', but skip hs-boot files: 'Module'
278+ -- does not distinguish boot from non-boot, so the real source file
279+ -- and its hs-boot share the same key. Callers (notably the
280+ -- 'GetLinkable' rule via 'lookupModuleFile') need the non-boot
281+ -- file because hs-boot files don't have linkables.
282+ reverseModuleMap = mkModuleEnv
283+ [ (showableModule sm, FilePathId i)
284+ | (i, sm) <- IntMap. toList rawModuleMap
285+ , Just al <- [IntMap. lookup i (idToPathMap rawPathIdMap)]
286+ , not (isBootLocation al)
287+ ]
277288
278289
279290-- | Given a dependency graph, buildResultGraph detects and propagates errors in that graph as follows:
0 commit comments