[commit: ghc] wip/T13633, wip/non-det-ci: Remove bogus assertion (ac34e78)

git at git.haskell.org git at git.haskell.org
Sun Feb 24 20:54:49 UTC 2019


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

On branches: wip/T13633,wip/non-det-ci
Link       : http://ghc.haskell.org/trac/ghc/changeset/ac34e784775a0fa8b7284d42ff89571907afdc36/ghc

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

commit ac34e784775a0fa8b7284d42ff89571907afdc36
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Feb 15 09:52:53 2019 +0000

    Remove bogus assertion
    
    Remove a bogus assertion in FamInst.newFamInst
    (There is a comment to explain.)
    
    This fixes Trac #16112.


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

ac34e784775a0fa8b7284d42ff89571907afdc36
 compiler/typecheck/FamInst.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs
index aec8e41..7efcb97 100644
--- a/compiler/typecheck/FamInst.hs
+++ b/compiler/typecheck/FamInst.hs
@@ -158,8 +158,10 @@ newFamInst :: FamFlavor -> CoAxiom Unbranched -> TcM FamInst
 -- Freshen the type variables of the FamInst branches
 newFamInst flavor axiom@(CoAxiom { co_ax_tc = fam_tc })
   = ASSERT2( tyCoVarsOfTypes lhs `subVarSet` tcv_set, text "lhs" <+> pp_ax )
-    ASSERT2( tyCoVarsOfType  rhs `subVarSet` tcv_set, text "rhs" <+> pp_ax )
     ASSERT2( lhs_kind `eqType` rhs_kind, text "kind" <+> pp_ax $$ ppr lhs_kind $$ ppr rhs_kind )
+    -- We used to have an assertion that the tyvars of the RHS were bound
+    -- by tcv_set, but in error situations like  F Int = a that isn't
+    -- true; a later check in checkValidFamInst rejects it
     do { (subst, tvs') <- freshenTyVarBndrs tvs
        ; (subst, cvs') <- freshenCoVarBndrsX subst cvs
        ; dflags <- getDynFlags



More information about the ghc-commits mailing list