Commit c1f01e35 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Do not discard insoluble constraints in simplifyInfer

Before -fdefer-type-errors there we no insolubles
(because we'd have failed before then), but with -fdefer-type-errors
there can be.  The code is acutally a bit simpler: we just call
emitConstraints, and eliminate the bogus-looking emitWC from TcRnMonad.

There's a bit more tidying up to do, concerning the places we use
keepWanted, but I need to talk to Dimitrios about that.

Meanwhile this fixes Trac #7023
parent 777cda76
......@@ -1031,11 +1031,6 @@ emitImplication ct
= do { lie_var <- getConstraintVar ;
updTcRef lie_var (`addImplics` unitBag ct) }
emitWC :: WantedConstraints -> TcM ()
emitWC wc
= do { emitFlats (keepWanted (wc_flat wc))
; emitImplications (wc_impl wc) }
emitImplications :: Bag Implication -> TcM ()
emitImplications ct
= do { lie_var <- getConstraintVar ;
......
......@@ -416,9 +416,10 @@ simplifyInfer _top_lvl apply_mr name_taus (untch,wanteds)
; if isEmptyVarSet qtvs && isEmptyBag bound
then ASSERT( isEmptyBag (wc_insol wanted_transformed) )
do { traceTc "} simplifyInfer/no quantification" empty
; emitWC wanted_transformed
then do { traceTc "} simplifyInfer/no quantification" empty
; emitConstraints wanted_transformed
-- Includes insolubles (if -fdefer-type-errors)
-- as well as flats and implications
; return ([], [], mr_bites, TcEvBinds ev_binds_var) }
else do
......
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