From: simonmar Date: Tue, 21 Aug 2001 15:54:22 +0000 (+0000) Subject: [project @ 2001-08-21 15:54:22 by simonmar] X-Git-Tag: Approximately_9120_patches~1143 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6df372f956e949fd1c84445ecc44c0c81ffd0897;p=ghc-hetmet.git [project @ 2001-08-21 15:54:22 by simonmar] Look for the source file first, so we don't miss it if there's an hi file in the current directory. --- diff --git a/ghc/compiler/main/Finder.lhs b/ghc/compiler/main/Finder.lhs index 5a4d8b7..f5fa664 100644 --- a/ghc/compiler/main/Finder.lhs +++ b/ghc/compiler/main/Finder.lhs @@ -67,27 +67,27 @@ maybeHomeModule mod_name is_source = do let mod_str = moduleNameUserString mod_name basename = map (\c -> if c == '.' then '/' else c) mod_str - -- last chance: .hi-boot- and .hi-boot - hi_boot_ver = "hi-boot-" ++ cHscIfaceFileVersion std_exts = - [ (hisuf, - \ _ fName path -> mkHiOnlyModuleLocn mod_name fName) - , ("hs", - \ _ fName path -> mkHomeModuleLocn mod_name path fName) - , ("lhs", - \ _ fName path -> mkHomeModuleLocn mod_name path fName) + [ ("hs", \ _ fName path -> mkHomeModuleLocn mod_name path fName) + , ("lhs", \ _ fName path -> mkHomeModuleLocn mod_name path fName) + , (hisuf, \ _ fName path -> mkHiOnlyModuleLocn mod_name fName) ] + -- look for the .hi file last, because if there's a source file about + -- we want to find it. + + -- last chance: .hi-boot- and .hi-boot + hi_boot_ver = "hi-boot-" ++ cHscIfaceFileVersion boot_exts = - [ (hi_boot_ver, \ _ fName path -> mkHiOnlyModuleLocn mod_name fName) - , ("hi-boot", \ _ fName path -> mkHiOnlyModuleLocn mod_name fName) - ] + [ (hi_boot_ver, \ _ fName path -> mkHiOnlyModuleLocn mod_name fName) + , ("hi-boot", \ _ fName path -> mkHiOnlyModuleLocn mod_name fName) + ] searchPathExts - (map ((,) undefined) home_path) - basename - (if is_source then (boot_exts++std_exts) else std_exts ++ boot_exts) + (map ((,) undefined) home_path) + basename + (if is_source then (boot_exts++std_exts) else std_exts ++ boot_exts) -- for SOURCE imports, check the hi-boot extensions -- before the source/iface ones, to avoid -- creating circ Makefile deps.