[commit: ghc] master: Comments only (00a9110)

git at git.haskell.org git at git.haskell.org
Mon Dec 30 12:11:19 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/00a9110243ded97494535dc450838f0aebb2c3f3/ghc

>---------------------------------------------------------------

commit 00a9110243ded97494535dc450838f0aebb2c3f3
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Dec 30 12:10:45 2013 +0000

    Comments only


>---------------------------------------------------------------

00a9110243ded97494535dc450838f0aebb2c3f3
 compiler/hsSyn/HsUtils.lhs |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/compiler/hsSyn/HsUtils.lhs b/compiler/hsSyn/HsUtils.lhs
index bdc77c0..218a452 100644
--- a/compiler/hsSyn/HsUtils.lhs
+++ b/compiler/hsSyn/HsUtils.lhs
@@ -694,10 +694,13 @@ hsLTyClDeclBinders :: Eq name => Located (TyClDecl name) -> [Located name]
 -- The first one is guaranteed to be the name of the decl. For record fields
 -- mentioned in multiple constructors, the SrcLoc will be from the first
 -- occurence.  We use the equality to filter out duplicate field names.
--- The @SrcLoc at s are the locations of the /declaration/, not just the name.
+--
+-- Each returned (Located name) is wrapped in a @SrcSpan@ of the whole
+-- /declaration/, not just the name itself (which is how it appears in
+-- the syntax tree).  This SrcSpan (for the entire declaration) is used
+-- as the SrcSpan for the Name that is finally produced, and hence for
+-- error messages.  (See Trac #8607.)
 
--- The re-mangling of the SrcLocs here are to keep good error messages while
--- avoiding #8607.
 hsLTyClDeclBinders (L loc (FamDecl { tcdFam = FamilyDecl { fdLName = L _ name } }))
   = [L loc name]
 hsLTyClDeclBinders (L loc (ForeignType { tcdLName = L _ name })) = [L loc name]



More information about the ghc-commits mailing list