[commit: ghc] wip/T12618: Fix calculation of res_ty in CoreFVs (d136b6b)
git at git.haskell.org
git at git.haskell.org
Fri Oct 21 19:15:57 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T12618
Link : http://ghc.haskell.org/trac/ghc/changeset/d136b6b84fc769e0c34c802b7125f90cf2de6c51/ghc
>---------------------------------------------------------------
commit d136b6b84fc769e0c34c802b7125f90cf2de6c51
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Fri Oct 21 15:13:43 2016 -0400
Fix calculation of res_ty in CoreFVs
but should the other code not have worked? Weird.
>---------------------------------------------------------------
d136b6b84fc769e0c34c802b7125f90cf2de6c51
compiler/coreSyn/CoreFVs.hs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/compiler/coreSyn/CoreFVs.hs b/compiler/coreSyn/CoreFVs.hs
index dc46280..12544b8 100644
--- a/compiler/coreSyn/CoreFVs.hs
+++ b/compiler/coreSyn/CoreFVs.hs
@@ -753,9 +753,12 @@ freeVars = go
where
cargs' = map go cargs
args = uncompressArgs exprTypeFV (go . Type) dc_ty cargs'
- arg_tys = map (exprToType . deAnnotate) args
dc_ty = dataConRepType dc
- res_ty = piResultTys dc_ty arg_tys
+ res_ty = foldl applyTypeToArg dc_ty (map deAnnotate args)
+ -- Why does this not work? Isn't piResultTys just iterated application
+ -- of piResultTy, which is what applyTypeToArg uses?
+ -- arg_tys = map (exprToType . deAnnotate) args
+ -- res_ty = piResultTys dc_ty arg_tys
go (Case scrut bndr ty alts)
= ( FVAnn { fva_fvs = (bndr `delBinderFV` alts_fvs)
More information about the ghc-commits
mailing list