diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2016-02-14 21:43:55 +0200 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2016-02-14 21:52:26 +0200 |
commit | cd4a7d07890fa53c455c14f22c2d30c22b64a396 (patch) | |
tree | 24cec95c07d47e1a0b3cba0f9103b613abac3c95 | |
parent | f37bb548157dae1e8c59d054c488b905c0f5abe0 (diff) | |
download | haskell-cd4a7d07890fa53c455c14f22c2d30c22b64a396.tar.gz |
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
-rw-r--r-- | compiler/rename/RnExpr.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs index e88f1e0831..69b8d6ea1b 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)); |