[commit: ghc] master: Allow non-Nominal covars (bugfix) (62d3fde)

git at git.haskell.org git at git.haskell.org
Tue Sep 3 17:25:36 CEST 2013


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/62d3fdeb9edfcfdeb661a6b8551ac2fc45b8595c/ghc

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

commit 62d3fdeb9edfcfdeb661a6b8551ac2fc45b8595c
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Tue Sep 3 10:27:02 2013 -0400

    Allow non-Nominal covars (bugfix)


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

62d3fdeb9edfcfdeb661a6b8551ac2fc45b8595c
 compiler/types/Coercion.lhs |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs
index 6cda16b..b0da3ed 100644
--- a/compiler/types/Coercion.lhs
+++ b/compiler/types/Coercion.lhs
@@ -802,7 +802,7 @@ isReflCo_maybe _                 = Nothing
 mkCoVarCo :: CoVar -> Coercion
 -- cv :: s ~# t
 mkCoVarCo cv
-  | ty1 `eqType` ty2 = Refl Nominal ty1
+  | ty1 `eqType` ty2 = Refl (coVarRole cv) ty1
   | otherwise        = CoVarCo cv
   where
     (ty1, ty2) = ASSERT( isCoVar cv ) coVarKind cv
@@ -1360,8 +1360,7 @@ subst_co subst co
 
 substCoVar :: CvSubst -> CoVar -> Coercion
 substCoVar (CvSubst in_scope _ cenv) cv
-  | Just co  <- lookupVarEnv cenv cv      = ASSERT2( coercionRole co == Nominal, ppr co )
-                                            co
+  | Just co  <- lookupVarEnv cenv cv      = co
   | Just cv1 <- lookupInScope in_scope cv = ASSERT( isCoVar cv1 ) CoVarCo cv1
   | otherwise = WARN( True, ptext (sLit "substCoVar not in scope") <+> ppr cv $$ ppr in_scope)
                 ASSERT( isCoVar cv ) CoVarCo cv





More information about the ghc-commits mailing list