[commit: ghc] type-holes-branch: Fix the incorrect abstraction over holes. (33feb9e)

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/33feb9e742b607bb8a76beb6716d3113426c3b9a

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

commit 33feb9e742b607bb8a76beb6716d3113426c3b9a
Author: Thijs Alkemade <[email protected]>
Date:   Thu May 24 11:44:09 2012 +0200

    Fix the incorrect abstraction over holes.
    
    This caused:
    
    f x = _
    
    To get the type:
    
    f :: t1 -> t -> t1
    
    Now it's:
    
    f :: t -> t1
    
    As it should.

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

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

diff --git a/compiler/typecheck/TcSimplify.lhs b/compiler/typecheck/TcSimplify.lhs
index eec3b9b..3005985 100644
--- a/compiler/typecheck/TcSimplify.lhs
+++ b/compiler/typecheck/TcSimplify.lhs
@@ -476,9 +476,12 @@ quantifyMe :: TyVarSet      -- Quantifying over these
 	   -> Bool	    -- True <=> quantify over this wanted
 quantifyMe qtvs ct
   | isIPPred pred = True  -- Note [Inheriting implicit parameters]
+  | isHoleCt ct = False
   | otherwise	  = tyVarsOfType pred `intersectsVarSet` qtvs
   where
     pred = ctPred ct
+    isHoleCt (CHoleCan {}) = True
+    isHoleCt _ = False
 \end{code}
 
 Note [Avoid unecessary constraint simplification]
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.