Fix Trac #2137: report correct location for shadowed binding
authorsimonpj@microsoft.com <unknown>
Wed, 2 Apr 2008 15:34:10 +0000 (15:34 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 2 Apr 2008 15:34:10 +0000 (15:34 +0000)
The error message generation for a shadowed binding was
plain wrong, at least where the shadowed binding isn't
top-level.  Just a typo really -- the fix is trivial.

compiler/rename/RnEnv.lhs

index 59451fc..35d3fcc 100644 (file)
@@ -886,7 +886,7 @@ checkShadowedNames doc_str (global_env,local_env) loc_rdr_names
        ; mappM_ check_shadow loc_rdr_names }
   where
     check_shadow (loc, occ)
-       | Just n <- mb_local = complain [ptext SLIT("bound at") <+> ppr loc]
+       | Just n <- mb_local = complain [ptext SLIT("bound at") <+> ppr (nameSrcLoc n)]
        | not (null gres)    = complain (map pprNameProvenance gres)
        | otherwise          = return ()
        where