From: Pepe Iborra Date: Wed, 14 Nov 2007 23:33:43 +0000 (+0000) Subject: Make pprNameLoc more robust in absence of loc information X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=3ad311341e189e574139921bd98449d7aed9ba26 Make pprNameLoc more robust in absence of loc information --- diff --git a/compiler/basicTypes/Name.lhs b/compiler/basicTypes/Name.lhs index e2f2723..c6e7d25 100644 --- a/compiler/basicTypes/Name.lhs +++ b/compiler/basicTypes/Name.lhs @@ -402,10 +402,13 @@ ppr_occ_name occ = ftext (occNameFS occ) -- cached behind the scenes in the FastString implementation. ppr_z_occ_name occ = ftext (zEncodeFS (occNameFS occ)) --- Prints "Defined at " or "Defined in " information for a Name. +-- Prints (if mod information is available) "Defined at " or +-- "Defined in " information for a Name. pprNameLoc :: Name -> SDoc pprNameLoc name | isGoodSrcSpan loc = pprDefnLoc loc + | isInternalName name || isSystemName name + = ptext SLIT("") | otherwise = ptext SLIT("Defined in ") <> ppr (nameModule name) where loc = nameSrcSpan name \end{code}