[commit: ghc] typeable-with-kinds: Bug-fix: the coercion was the wrong way around. (cc0f70b)

git at git.haskell.org git at git.haskell.org
Tue Feb 10 22:48:19 UTC 2015


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

On branch  : typeable-with-kinds
Link       : http://ghc.haskell.org/trac/ghc/changeset/cc0f70b95264875ba40a1bb7d90a1c9c0009da1a/ghc

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

commit cc0f70b95264875ba40a1bb7d90a1c9c0009da1a
Author: Iavor S. Diatchki <diatchki at galois.com>
Date:   Tue Feb 10 14:37:47 2015 -0800

    Bug-fix: the coercion was the wrong way around.


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

cc0f70b95264875ba40a1bb7d90a1c9c0009da1a
 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 6db3cae..eebf298 100644
--- a/compiler/deSugar/DsBinds.hs
+++ b/compiler/deSugar/DsBinds.hs
@@ -945,7 +945,7 @@ dsEvTypeable ev =
                 $ mkLams [mkWildValBinder proxyT] (Var repName)
 
      -- package up the method as `Typeable` dictionary
-     return (mkCast method (getTypeableCo tyCl ty))
+     return $ mkCast method $ mkSymCo $ getTypeableCo tyCl ty
 
   where
   -- co: method -> Typeable k t
@@ -958,7 +958,7 @@ dsEvTypeable ev =
   getRep tc (ev,t) =
     do typeableExpr <- dsEvTerm ev
        let co     = getTypeableCo tc t
-           method = mkCast typeableExpr (mkSymCo co)
+           method = mkCast typeableExpr co
            proxy  = mkTyApps (Var proxyHashId) [t]
        return (mkApps method [proxy])
 



More information about the ghc-commits mailing list