diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2015-12-20 10:56:24 +0200 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2015-12-21 12:12:57 +0200 |
commit | d8ed20c8772bee5eb83719c804121374157cf9b6 (patch) | |
tree | 4f53ebe4f80271474b3d1ea6c48e30ba982a0916 /compiler/hsSyn/HsUtils.hs | |
parent | 850710ab8c0fe69ea053d48583071fe1e5ffd067 (diff) | |
download | haskell-d8ed20c8772bee5eb83719c804121374157cf9b6.tar.gz |
Add Location to RdrName in FieldOcc
Summary:
Post #11019, there have been some new instances of RdrName that are not
located, in particular
```#!hs
data FieldOcc name = FieldOcc { rdrNameFieldOcc :: RdrName
, selectorFieldOcc :: PostRn name name
}
data AmbiguousFieldOcc name
= Unambiguous RdrName (PostRn name name)
| Ambiguous RdrName (PostTc name name)
deriving (Typeable)
```
Add locations to them
Updates haddock submodule to match
Test Plan: ./validate
Reviewers: goldfire, hvr, bgamari, austin
Reviewed By: hvr
Subscribers: hvr, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D1670
GHC Trac Issues: #11258
Diffstat (limited to 'compiler/hsSyn/HsUtils.hs')
-rw-r--r-- | compiler/hsSyn/HsUtils.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index fb969ebff1..3cfcb06fd0 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -981,7 +981,7 @@ hsConDeclsBinders cons = go id cons where r' = remSeen (concatMap (cd_fld_names . unLoc) flds) remSeen' = foldr (.) remSeen [deleteBy ((==) `on` - rdrNameFieldOcc . unLoc) v + unLoc . rdrNameFieldOcc . unLoc) v | v <- r'] (ns, fs) = go remSeen' rs @@ -990,7 +990,10 @@ hsConDeclsBinders cons = go id cons ([L loc (unLoc name)] ++ ns, r' ++ fs) where r' = remSeen (concatMap (cd_fld_names . unLoc) (unLoc flds)) - remSeen' = foldr (.) remSeen [deleteBy ((==) `on` rdrNameFieldOcc . unLoc) v | v <- r'] + remSeen' + = foldr (.) remSeen + [deleteBy ((==) `on` + unLoc . rdrNameFieldOcc . unLoc) v | v <- r'] (ns, fs) = go remSeen' rs L loc (ConDeclH98 { con_name = name }) -> ([L loc (unLoc name)] ++ ns, fs) |