[commit: ghc] type-holes-branch: Make sure ambiguous class constraints still get deferred, otherwise it fails at runtime. (40b8903)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : type-holes-branch

http://hackage.haskell.org/trac/ghc/changeset/40b890331dfe93054f5b16c71082372d6fe3ce2d

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

commit 40b890331dfe93054f5b16c71082372d6fe3ce2d
Author: Thijs Alkemade <[email protected]>
Date:   Fri Apr 27 11:54:01 2012 +0200

    Make sure ambiguous class constraints still get deferred, otherwise it fails at runtime.

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

 compiler/typecheck/TcErrors.lhs |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/compiler/typecheck/TcErrors.lhs b/compiler/typecheck/TcErrors.lhs
index d353ece..b758998 100644
--- a/compiler/typecheck/TcErrors.lhs
+++ b/compiler/typecheck/TcErrors.lhs
@@ -154,9 +154,11 @@ reportTidyWanteds ctxt insols flats implics
           }
        else 
        do {
-            ; traceTc "reportTidyWanteds" (ppr deferred)
+            ; traceTc "reportTidyWanteds" (ppr $ mapBag ic_given implics)
             ; mapBagM_ (deferToRuntime ev_binds_var ctxt (mkHoleDeferredError deferred))
                        holes
+            ; mapBagM_ (deferToRuntime ev_binds_var ctxt mkFlatErr)
+                       (filterBag (\x -> isDeferred x && (not $ isHole x)) (flats `unionBags` insols))
             ; reportInsolsAndFlats ctxt (filterBag (not.isDeferred) insols) (filterBag (not.isDeferred) flats)
             ; mapBagM_ (reportImplic ctxt) implics
           }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.