[commit: ghc] wip/impredicativity: Fix missing conversion to repr. equality in InstanceOf (ad32e64)

git at git.haskell.org git at git.haskell.org
Tue Jun 23 14:13:32 UTC 2015


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

On branch  : wip/impredicativity
Link       : http://ghc.haskell.org/trac/ghc/changeset/ad32e64bae3ab10d509ed44f7a6f747d28d55413/ghc

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

commit ad32e64bae3ab10d509ed44f7a6f747d28d55413
Author: Alejandro Serrano <trupill at gmail.com>
Date:   Tue Jun 23 16:14:01 2015 +0200

    Fix missing conversion to repr. equality in InstanceOf


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

ad32e64bae3ab10d509ed44f7a6f747d28d55413
 compiler/deSugar/DsBinds.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs
index fa0404f..95656ad 100644
--- a/compiler/deSugar/DsBinds.hs
+++ b/compiler/deSugar/DsBinds.hs
@@ -1159,12 +1159,12 @@ dsEvInstanceOf _  (EvInstanceOfVar v)
   = return (Var v)
 dsEvInstanceOf ty (EvInstanceOfEq co)
   = do { bndr <- newSysLocalDs ty
-       ; expr <- dsTcCoercion co (Cast (Var bndr))
+       ; expr <- dsTcCoercion co (\c -> Cast (Var bndr) (mkSubCo c))
        ; return (mkCoreLams [bndr] expr) }
 dsEvInstanceOf ty (EvInstanceOfInst qvars co qs)
   = do { bndr <- newSysLocalDs ty
        ; qs'  <- mapM dsEvTerm qs
        ; let exprTy = foldl (\e t -> App e (Type t)) (Var bndr) qvars
              exprEv = foldl App exprTy qs'
-       ; expr <- dsTcCoercion co (Cast exprEv)
+       ; expr <- dsTcCoercion co (\c -> Cast exprEv (mkSubCo c))
        ; return (mkCoreLams [bndr] expr) }



More information about the ghc-commits mailing list