diff options
author | Zubin Duggal <zubin@cmi.ac.in> | 2020-09-17 14:29:26 +0530 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-09-25 21:11:32 -0400 |
commit | 29885f076219d878d2c976e78b7960a1a5938a96 (patch) | |
tree | 6b7a36cfadec6cf665c73103e671a36cb3b8525c | |
parent | 5b78e8658c3f5042967cbe9d30a5a630946c4fd7 (diff) | |
download | haskell-29885f076219d878d2c976e78b7960a1a5938a96.tar.gz |
Stop removing definitions of record fields in GHC.Iface.Ext.Ast
-rw-r--r-- | compiler/GHC/Iface/Ext/Ast.hs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs index ffc9c0a742..68bbc103b5 100644 --- a/compiler/GHC/Iface/Ext/Ast.hs +++ b/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 |