From: simonpj Date: Thu, 6 May 2004 12:23:58 +0000 (+0000) Subject: [project @ 2004-05-06 12:23:58 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~1866 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=026f6c3854a61b51f1efdf5e43f102440871d254;p=ghc-hetmet.git [project @ 2004-05-06 12:23:58 by simonpj] Comments --- diff --git a/ghc/compiler/basicTypes/RdrName.lhs b/ghc/compiler/basicTypes/RdrName.lhs index e84a391..82cabf6 100644 --- a/ghc/compiler/basicTypes/RdrName.lhs +++ b/ghc/compiler/basicTypes/RdrName.lhs @@ -476,11 +476,13 @@ pprNameProvenance (GRE {gre_name = name, gre_prov = LocalDef _}) pprNameProvenance (GRE {gre_name = name, gre_prov = Imported (why:whys) _}) = sep [ppr why, nest 2 (ppr_defn (nameSrcLoc name))] +-- If we know the exact definition point (which we may do with GHCi) +-- then show that too. But not if it's just "imported from X". +ppr_defn loc | isGoodSrcLoc loc = parens (ptext SLIT("defined at") <+> ppr loc) + | otherwise = empty + instance Outputable ImportSpec where ppr imp_spec = ptext SLIT("imported from") <+> ppr (is_mod imp_spec) <+> ptext SLIT("at") <+> ppr (is_loc imp_spec) - -ppr_defn loc | isGoodSrcLoc loc = parens (ptext SLIT("defined at") <+> ppr loc) - | otherwise = empty \end{code}