Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Tobias Decking
GHC
Commits
a022fe50
Commit
a022fe50
authored
Oct 04, 2004
by
simonpj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2004-10-04 09:11:09 by simonpj]
Improve error locations for binding conflicts
parent
870b2298
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
ghc/compiler/rename/RnEnv.lhs
ghc/compiler/rename/RnEnv.lhs
+14
-6
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/rename/RnExpr.lhs
+1
-1
No files found.
ghc/compiler/rename/RnEnv.lhs
View file @
a022fe50
...
...
@@ -54,7 +54,7 @@ import PrelNames ( mkUnboundName, rOOT_MAIN_Name, iNTERACTIVE, consDataConKey, h
import UniqSupply
import BasicTypes ( IPName, mapIPName )
import SrcLoc ( SrcSpan, srcSpanStart, Located(..), eqLocated, unLoc,
srcLocSpan )
srcLocSpan
, getLoc, combineSrcSpans, srcSpanStartLine, srcSpanEndLine
)
import Outputable
import ListSetOps ( removeDups )
import List ( nubBy )
...
...
@@ -747,9 +747,17 @@ badOrigBinding name
= ptext SLIT("Illegal binding of built-in syntax:") <+> ppr (rdrNameOcc name)
-- The rdrNameOcc is because we don't want to print Prelude.(,)
dupNamesErr descriptor (L loc name : dup_things)
= setSrcSpan loc $
addErr ((ptext SLIT("Conflicting definitions for") <+> quotes (ppr name))
$$
descriptor)
dupNamesErr :: SDoc -> [Located RdrName] -> RnM ()
dupNamesErr descriptor located_names
= setSrcSpan big_loc $
addErr (vcat [ptext SLIT("Conflicting definitions for") <+> quotes (ppr name1),
locations,
descriptor])
where
L _ name1 = head located_names
locs = map getLoc located_names
big_loc = foldr1 combineSrcSpans locs
one_line = srcSpanStartLine big_loc == srcSpanEndLine big_loc
locations | one_line = empty
| otherwise = ptext SLIT("Bound at:") <+> vcat (map ppr locs)
\end{code}
ghc/compiler/rename/RnExpr.lhs
View file @
a022fe50
...
...
@@ -831,7 +831,7 @@ rnMDoStmts stmts
in
returnM stmts_w_fvs
where
doc = text "In a mdo-expression"
doc = text "In a
recursive
mdo-expression"
----------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment