[commit: ghc] wip/tdammers/D4394: Another fix as per D4394 (c9212b4)

git at git.haskell.org git at git.haskell.org
Tue Mar 20 11:53:50 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/tdammers/D4394
Link       : http://ghc.haskell.org/trac/ghc/changeset/c9212b4764de580c647dc722cbfe6fd6d4b61c19/ghc

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

commit c9212b4764de580c647dc722cbfe6fd6d4b61c19
Author: Tobias Dammers <tdammers at gmail.com>
Date:   Mon Mar 5 12:50:35 2018 +0100

    Another fix as per D4394


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

c9212b4764de580c647dc722cbfe6fd6d4b61c19
 compiler/types/Coercion.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/types/Coercion.hs b/compiler/types/Coercion.hs
index dd4d055..8550e85 100644
--- a/compiler/types/Coercion.hs
+++ b/compiler/types/Coercion.hs
@@ -1295,7 +1295,7 @@ mkCoCast c g
       | tc `hasKey` heqTyConKey        = (4, Nominal)
       | tc `hasKey` coercibleTyConKey  = (3, Representational)
       | otherwise                      = pprPanic "mkCoCast" (ppr g $$ ppr (coercionKind g))
-    co_list = decomposeCo n_args g (replicate (n_args - 2) Nominal ++ repeat role)
+    co_list = decomposeCo (tyConArity tc) g (tyConRolesRepresentational tc)
     g1 = co_list `getNth` (n_args - 2)
     g2 = co_list `getNth` (n_args - 1)
 



More information about the ghc-commits mailing list