Commit 6e55d34a authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Fix Trac #2137: report correct location for shadowed binding

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.
parent 1c9ffbe6
...@@ -886,7 +886,7 @@ checkShadowedNames doc_str (global_env,local_env) loc_rdr_names ...@@ -886,7 +886,7 @@ checkShadowedNames doc_str (global_env,local_env) loc_rdr_names
; mappM_ check_shadow loc_rdr_names } ; mappM_ check_shadow loc_rdr_names }
where where
check_shadow (loc, occ) 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) | not (null gres) = complain (map pprNameProvenance gres)
| otherwise = return () | otherwise = return ()
where where
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment