summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2009-02-04 08:38:00 +0000
committersimonpj@microsoft.com <unknown>2009-02-04 08:38:00 +0000
commit9524fc33fdd65eca2c29be0dd03904fae4b22f46 (patch)
treef49541d387ff3fc68516b73fe95ff6129f8e8e00 /compiler
parent6561069ad5d0b11de223686be59372a3b1e6aed7 (diff)
downloadhaskell-9524fc33fdd65eca2c29be0dd03904fae4b22f46.tar.gz
Fix Trac #2999: change an ASSERT to a WARN
A bug in the constraint simplifier means that an equality can be solved twice. It's harmless, and will go away with the new constraint simplifier. Hence warning, to avoid unnecessary outright failure on eg Trac #2999.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/typecheck/TcTyFuns.lhs11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/typecheck/TcTyFuns.lhs b/compiler/typecheck/TcTyFuns.lhs
index 0066d2fd03..5777955ed7 100644
--- a/compiler/typecheck/TcTyFuns.lhs
+++ b/compiler/typecheck/TcTyFuns.lhs
@@ -37,6 +37,7 @@ import Name
import Bag
import Outputable
import SrcLoc ( Located(..) )
+import Util ( debugIsOn )
import Maybes
import FastString
@@ -278,7 +279,15 @@ no further propoagation is possible.
--
normaliseEqs :: [Inst] -> TcM EqConfig
normaliseEqs eqs
- = do { ASSERTM2( allM wantedEqInstIsUnsolved eqs, ppr eqs )
+ = do { if debugIsOn then do { all_unsolved <- allM wantedEqInstIsUnsolved eqs
+ ; let msg = ptext (sLit "(This warning is harmless; for Simon & Manuel)")
+ ; WARN( not all_unsolved, msg $$ ppr eqs ) return () }
+ else return ()
+ -- This is just a warning (not an error) because a current
+ -- harmless bug means that we sometimes solve the same
+ -- equality more than once It'll go away with the new
+ -- solver. See Trac #2999 for example
+
; traceTc $ ptext (sLit "Entering normaliseEqs")
; (eqss, skolemss) <- mapAndUnzipM normEqInst eqs