[commit: ghc] wip/libdw-prof: OptCoercion: Ensure that TyConApps match in arity (2d5c377)

git at git.haskell.org git at git.haskell.org
Sun May 7 21:41:55 UTC 2017


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

On branch  : wip/libdw-prof
Link       : http://ghc.haskell.org/trac/ghc/changeset/2d5c377569253f3468efc0577d07e1ef281e9d99/ghc

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

commit 2d5c377569253f3468efc0577d07e1ef281e9d99
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sun May 7 14:48:41 2017 -0400

    OptCoercion: Ensure that TyConApps match in arity
    
    Previously we would


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

2d5c377569253f3468efc0577d07e1ef281e9d99
 compiler/types/OptCoercion.hs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/types/OptCoercion.hs b/compiler/types/OptCoercion.hs
index b1aa646..03e1d6c 100644
--- a/compiler/types/OptCoercion.hs
+++ b/compiler/types/OptCoercion.hs
@@ -378,6 +378,7 @@ opt_univ env sym prov role oty1 oty2
   | Just (tc1, tys1) <- splitTyConApp_maybe oty1
   , Just (tc2, tys2) <- splitTyConApp_maybe oty2
   , tc1 == tc2
+  , equalLength tys1 tys2
       -- NB: prov must not be the two interesting ones (ProofIrrel & Phantom);
       -- Phantom is already taken care of, and ProofIrrel doesn't relate tyconapps
   = let roles    = tyConRolesX role tc1



More information about the ghc-commits mailing list