summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2013-09-03 10:27:02 -0400
committerRichard Eisenberg <eir@cis.upenn.edu>2013-09-03 10:27:02 -0400
commit62d3fdeb9edfcfdeb661a6b8551ac2fc45b8595c (patch)
treeb3b2f1e55df568fd4b5d7fd629f395efd185e095
parentbe7f10bb9486462247edb6aae9a3e5f46cfe4908 (diff)
downloadhaskell-62d3fdeb9edfcfdeb661a6b8551ac2fc45b8595c.tar.gz
Allow non-Nominal covars (bugfix)
-rw-r--r--compiler/types/Coercion.lhs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs
index 6cda16b9ec..b0da3edd53 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