[commit: ghc] wip/impredicativity: Fix small glitch choosing wrong cast in Core (1960ad9)

git at git.haskell.org git at git.haskell.org
Fri Jun 19 11:49:36 UTC 2015


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

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

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

commit 1960ad944de43a639252e6407d83f3fa488cd3b6
Author: Alejandro Serrano <trupill at gmail.com>
Date:   Fri Jun 19 13:47:11 2015 +0200

    Fix small glitch choosing wrong cast in Core
    
    Previously, mkCast was called, which expected a
    representational equality, which was not always the
    case. Change to simple Cast to fix it.


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

1960ad944de43a639252e6407d83f3fa488cd3b6
 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 4d7ab9d..fa0404f 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 (mkCast (Var bndr))
+       ; expr <- dsTcCoercion co (Cast (Var bndr))
        ; 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 (mkCast exprEv)
+       ; expr <- dsTcCoercion co (Cast exprEv)
        ; return (mkCoreLams [bndr] expr) }



More information about the ghc-commits mailing list