diff options
author | M Farkas-Dyck <strake888@proton.me> | 2022-10-17 22:46:03 -0800 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-10-19 10:47:13 -0400 |
commit | c3732c6210972a992e1153b0667cf8abf0351acd (patch) | |
tree | e215a94569287d58320dad20ca0accbff8023052 /compiler/GHC/Tc | |
parent | 83638dce4e20097b9b7073534e488a92dce6e88f (diff) | |
download | haskell-c3732c6210972a992e1153b0667cf8abf0351acd.tar.gz |
Enforce invariant of `ListBag` constructor.
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Deriv.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Deriv.hs b/compiler/GHC/Tc/Deriv.hs index 0a873ff05e..feefb05ac1 100644 --- a/compiler/GHC/Tc/Deriv.hs +++ b/compiler/GHC/Tc/Deriv.hs @@ -289,8 +289,8 @@ renameDeriv inst_infos bagBinds -- Bring the extra deriving stuff into scope -- before renaming the instances themselves ; traceTc "rnd" (vcat (map (\i -> pprInstInfoDetails i $$ text "") inst_infos)) - ; (aux_binds, aux_sigs) <- mapAndUnzipBagM return bagBinds - ; let aux_val_binds = ValBinds NoAnnSortKey aux_binds (bagToList aux_sigs) + ; let (aux_binds, aux_sigs) = unzipBag bagBinds + aux_val_binds = ValBinds NoAnnSortKey aux_binds (bagToList aux_sigs) -- Importantly, we use rnLocalValBindsLHS, not rnTopBindsLHS, to rename -- auxiliary bindings as if they were defined locally. -- See Note [Auxiliary binders] in GHC.Tc.Deriv.Generate. |