[commit: ghc] master: renamer discards name location for HsRecField (cd4a7d0)

git at git.haskell.org git at git.haskell.org
Sun Feb 14 19:51:32 UTC 2016


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

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

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

commit cd4a7d07890fa53c455c14f22c2d30c22b64a396
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Sun Feb 14 21:43:55 2016 +0200

    renamer discards name location for HsRecField
    
    When renaming a HsVar it can be converted to a HsRecField. In the
    process the location of the enclosed name is converted to a noLoc
    
    Closes #11576


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

cd4a7d07890fa53c455c14f22c2d30c22b64a396
 compiler/rename/RnExpr.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs
index e88f1e0..69b8d6e 100644
--- a/compiler/rename/RnExpr.hs
+++ b/compiler/rename/RnExpr.hs
@@ -108,8 +108,9 @@ rnExpr (HsVar (L l v))
 
               | otherwise
               -> finishHsVar (L l name) ;
-           Just (Right [f])        -> return (HsRecFld (ambiguousFieldOcc f)
-                                             , unitFV (selectorFieldOcc f)) ;
+            Just (Right [f@(FieldOcc (L _ fn) s)]) ->
+                      return (HsRecFld (ambiguousFieldOcc (FieldOcc (L l fn) s))
+                             , unitFV (selectorFieldOcc f)) ;
            Just (Right fs@(_:_:_)) -> return (HsRecFld (Ambiguous (L l v)
                                                         PlaceHolder)
                                              , mkFVs (map selectorFieldOcc fs));



More information about the ghc-commits mailing list