[Git][ghc/ghc][master] Stop removing definitions of record fields in GHC.Iface.Ext.Ast

Marge Bot gitlab at gitlab.haskell.org
Sat Sep 26 01:11:40 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
29885f07 by Zubin Duggal at 2020-09-25T21:11:32-04:00
Stop removing definitions of record fields in GHC.Iface.Ext.Ast

- - - - -


1 changed file:

- compiler/GHC/Iface/Ext/Ast.hs


Changes:

=====================================
compiler/GHC/Iface/Ext/Ast.hs
=====================================
@@ -42,7 +42,7 @@ import GHC.Driver.Types
 import GHC.Unit.Module            ( ModuleName, ml_hs_file )
 import GHC.Utils.Monad            ( concatMapM, liftIO )
 import GHC.Types.Id               ( isDataConId_maybe )
-import GHC.Types.Name             ( Name, nameSrcSpan, setNameLoc, nameUnique )
+import GHC.Types.Name             ( Name, nameSrcSpan, nameUnique )
 import GHC.Types.Name.Env         ( NameEnv, emptyNameEnv, extendNameEnv, lookupNameEnv )
 import GHC.Types.SrcLoc
 import GHC.Tc.Utils.Zonk          ( hsLitType, hsPatType )
@@ -52,7 +52,7 @@ import GHC.Core.InstEnv
 import GHC.Builtin.Types          ( mkListTy, mkSumTy )
 import GHC.Tc.Types
 import GHC.Tc.Types.Evidence
-import GHC.Types.Var              ( Id, Var, EvId, setVarName, varName, varType, varUnique )
+import GHC.Types.Var              ( Id, Var, EvId, varName, setVarName, varType, varUnique )
 import GHC.Types.Var.Env
 import GHC.Builtin.Uniques
 import GHC.Iface.Make             ( mkIfaceExports )
@@ -1276,26 +1276,22 @@ instance ( ToHie (RFContext (Located label))
       , toHie expr
       ]
 
-removeDefSrcSpan :: Name -> Name
-removeDefSrcSpan n = setNameLoc n noSrcSpan
-
 instance ToHie (RFContext (Located (FieldOcc GhcRn))) where
   toHie (RFC c rhs (L nspan f)) = concatM $ case f of
     FieldOcc name _ ->
-      [ toHie $ C (RecField c rhs) (L nspan $ removeDefSrcSpan name)
+      [ toHie $ C (RecField c rhs) (L nspan name)
       ]
 
 instance ToHie (RFContext (Located (FieldOcc GhcTc))) where
   toHie (RFC c rhs (L nspan f)) = concatM $ case f of
     FieldOcc var _ ->
-      let var' = setVarName var (removeDefSrcSpan $ varName var)
-      in [ toHie $ C (RecField c rhs) (L nspan var')
-         ]
+      [ toHie $ C (RecField c rhs) (L nspan var)
+      ]
 
 instance ToHie (RFContext (Located (AmbiguousFieldOcc GhcRn))) where
   toHie (RFC c rhs (L nspan afo)) = concatM $ case afo of
     Unambiguous name _ ->
-      [ toHie $ C (RecField c rhs) $ L nspan $ removeDefSrcSpan name
+      [ toHie $ C (RecField c rhs) $ L nspan name
       ]
     Ambiguous _name _ ->
       [ ]
@@ -1303,13 +1299,11 @@ instance ToHie (RFContext (Located (AmbiguousFieldOcc GhcRn))) where
 instance ToHie (RFContext (Located (AmbiguousFieldOcc GhcTc))) where
   toHie (RFC c rhs (L nspan afo)) = concatM $ case afo of
     Unambiguous var _ ->
-      let var' = setVarName var (removeDefSrcSpan $ varName var)
-      in [ toHie $ C (RecField c rhs) (L nspan var')
-         ]
+      [ toHie $ C (RecField c rhs) (L nspan var)
+      ]
     Ambiguous var _ ->
-      let var' = setVarName var (removeDefSrcSpan $ varName var)
-      in [ toHie $ C (RecField c rhs) (L nspan var')
-         ]
+      [ toHie $ C (RecField c rhs) (L nspan var)
+      ]
 
 instance HiePass p => ToHie (RScoped (ApplicativeArg (GhcPass p))) where
   toHie (RS sc (ApplicativeArgOne _ pat expr _)) = concatM



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/29885f076219d878d2c976e78b7960a1a5938a96

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/29885f076219d878d2c976e78b7960a1a5938a96
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200925/6815e355/attachment-0001.html>


More information about the ghc-commits mailing list