[commit: ghc] : Fix to KPush that somehow got missed when I put universal type args in Data (9ac9f96)

Max Bolingbroke <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : 

http://hackage.haskell.org/trac/ghc/changeset/9ac9f960cc017b17fafcf000c62180f7906d9975

>---------------------------------------------------------------

commit 9ac9f960cc017b17fafcf000c62180f7906d9975
Author: Max Bolingbroke <[email protected]>
Date:   Tue Aug 2 23:34:40 2011 +0100

    Fix to KPush that somehow got missed when I put universal type args in Data

>---------------------------------------------------------------

 .../Supercompile/Evaluator/Evaluate.hs             |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs b/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
index 3ddc9d0..fc9c898 100644
--- a/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
+++ b/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
@@ -252,9 +252,12 @@ step' normalising state =
                                             arg_tys        = dataConRepArgTys dc
                                         
                                             -- Make the "theta" from Fig 3 of the paper
+                                            (_univ_tys, ex_tys) = splitAt tc_arity tys
                                             gammas = decomposeCo tc_arity co'
-                                            theta_subst = liftCoSubstWith (dc_univ_tyvars ++ dc_ex_tyvars)
-                                                                          (gammas         ++ map mkReflCo tys)
+                                            theta_subst = ASSERT2(length dc_univ_tyvars == tc_arity,      ppr dc $$ ppr dc_univ_tyvars $$ ppr tc_arity)
+                                                          ASSERT2(length dc_ex_tyvars   == length ex_tys, ppr dc $$ ppr dc_ex_tyvars $$ ppr (length ex_tys))
+                                                          liftCoSubstWith (dc_univ_tyvars ++ dc_ex_tyvars)
+                                                                          (gammas         ++ map mkReflCo ex_tys)
                                         in map (\arg_ty -> (theta_subst arg_ty, tg_co)) arg_tys -- Use tag from the original coercion everywhere
            -- b) Identify the first appropriate branch of the case and reduce -- apply the discovered coercions if necessary
           , (deeds3, h', ids', alt_e):_ <- [ res
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.