Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/c1f01e351759e7c25818b05e32bdb7b702dac6f2

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

commit c1f01e351759e7c25818b05e32bdb7b702dac6f2
Author: Simon Peyton Jones <[email protected]>
Date:   Sat Jul 14 13:18:34 2012 +0100

    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

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

 compiler/typecheck/TcRnMonad.lhs  |    5 -----
 compiler/typecheck/TcSimplify.lhs |    7 ++++---
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/compiler/typecheck/TcRnMonad.lhs b/compiler/typecheck/TcRnMonad.lhs
index f685998..1b60061 100644
--- a/compiler/typecheck/TcRnMonad.lhs
+++ b/compiler/typecheck/TcRnMonad.lhs
@@ -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 ;
diff --git a/compiler/typecheck/TcSimplify.lhs 
b/compiler/typecheck/TcSimplify.lhs
index 2c4d318..4417408 100644
--- a/compiler/typecheck/TcSimplify.lhs
+++ b/compiler/typecheck/TcSimplify.lhs
@@ -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
 



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to