diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2019-11-26 20:08:32 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-02 03:42:57 -0500 |
commit | 65400314244b2486dc4740a4aadd4e1225d38e3c (patch) | |
tree | ef348596a05536a3ed625b5b4d844023c462bbcf /compiler | |
parent | 53251413348186c8fbe2bbe9c2702d274e469324 (diff) | |
download | haskell-65400314244b2486dc4740a4aadd4e1225d38e3c.tar.gz |
Convert warnings into assertions
Since the invariants always hold in the testsuite, we can convert
them to asserts.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/iface/IfaceSyn.hs | 4 | ||||
-rw-r--r-- | compiler/typecheck/TcTyClsDecls.hs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/iface/IfaceSyn.hs b/compiler/iface/IfaceSyn.hs index f691300157..78eb3ea271 100644 --- a/compiler/iface/IfaceSyn.hs +++ b/compiler/iface/IfaceSyn.hs @@ -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 diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index 52d9e57229..545f001f00 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -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 |