From 3ad311341e189e574139921bd98449d7aed9ba26 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Wed, 14 Nov 2007 23:33:43 +0000 Subject: [PATCH] Make pprNameLoc more robust in absence of loc information --- compiler/basicTypes/Name.lhs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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} -- 1.7.10.4