[commit: ghc] ghc-8.0: renamer discards name location for HsRecField (62ed152)

git at git.haskell.org git at git.haskell.org
Thu Feb 18 12:03:41 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/62ed15255135b953e93fec0cf793b16ce1722163/ghc

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

commit 62ed15255135b953e93fec0cf793b16ce1722163
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
    
    (cherry picked from commit cd4a7d07890fa53c455c14f22c2d30c22b64a396)


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

62ed15255135b953e93fec0cf793b16ce1722163
 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