[commit: ghc] ghc-7.10: Fix #10489 (3e1366e)

git at git.haskell.org git at git.haskell.org
Fri Jul 31 12:44:05 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/3e1366e34e578fec9cbb2d34ccf0be380fbb2235/ghc

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

commit 3e1366e34e578fec9cbb2d34ccf0be380fbb2235
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Fri Jun 5 09:56:21 2015 -0400

    Fix #10489
    
    Dang, roles are annoying.
    
    Test case: typecheck/should_compile/T10489
    
    Cherry-Picked-From: 61b96a86c5342fb1c850361177d60fe855d948f6
    Conflicts:
    	testsuite/tests/typecheck/should_compile/all.T


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

3e1366e34e578fec9cbb2d34ccf0be380fbb2235
 compiler/hsSyn/HsUtils.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs
index 4a80ebd..ad438e5 100644
--- a/compiler/hsSyn/HsUtils.hs
+++ b/compiler/hsSyn/HsUtils.hs
@@ -504,9 +504,10 @@ mkHsWrapPat :: HsWrapper -> Pat id -> Type -> Pat id
 mkHsWrapPat co_fn p ty | isIdHsWrapper co_fn = p
                        | otherwise           = CoPat co_fn p ty
 
+-- input coercion is Nominal
 mkHsWrapPatCo :: TcCoercion -> Pat id -> Type -> Pat id
 mkHsWrapPatCo co pat ty | isTcReflCo co = pat
-                        | otherwise     = CoPat (mkWpCast co) pat ty
+                        | otherwise     = CoPat (mkWpCast (mkTcSubCo co)) pat ty
 
 mkHsDictLet :: TcEvBinds -> LHsExpr Id -> LHsExpr Id
 mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr



More information about the ghc-commits mailing list