Commit 65400314 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski Committed by Marge Bot

Convert warnings into assertions

Since the invariants always hold in the testsuite, we can convert
them to asserts.
parent 53251413
Pipeline #13385 passed with stages
in 429 minutes and 58 seconds
......@@ -67,7 +67,7 @@ import Binary
import BooleanFormula ( BooleanFormula, pprBooleanFormula, isTrue )
import Var( VarBndr(..), binderVar )
import TyCon ( Role (..), Injectivity(..), tyConBndrVisArgFlag )
import Util( dropList, filterByList, notNull, unzipWith )
import Util( dropList, filterByList, notNull, unzipWith, debugIsOn )
import DataCon (SrcStrictness(..), SrcUnpackedness(..))
import Lexeme (isLexSym)
import TysWiredIn ( constraintKindTyConName )
......@@ -594,7 +594,7 @@ pprAxBranch pp_tc idx (IfaceAxBranch { ifaxbTyVars = tvs
, ifaxbLHS = pat_tys
, ifaxbRHS = rhs
, ifaxbIncomps = incomps })
= WARN( not (null _cvs), pp_tc $$ ppr _cvs )
= ASSERT2( null _cvs, pp_tc $$ ppr _cvs )
hang ppr_binders 2 (hang pp_lhs 2 (equals <+> ppr rhs))
$+$
nest 4 maybe_incomps
......
......@@ -3546,12 +3546,12 @@ checkValidDataCon dflags existential_ok tc con
user_tvbs_invariant
= Set.fromList (filterEqSpec eq_spec univs ++ exs)
== Set.fromList user_tvs
; WARN( not user_tvbs_invariant
; MASSERT2( user_tvbs_invariant
, vcat ([ ppr con
, ppr univs
, ppr exs
, ppr eq_spec
, ppr user_tvs ])) return () }
, ppr user_tvs ])) }
; traceTc "Done validity of data con" $
vcat [ ppr con
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment