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

Simon Peyton Jones simonpj at microsoft.com
Mon Sep 17 13:03:55 CEST 2012


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 <thijsalkemade at gmail.com>
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]





More information about the Cvs-ghc mailing list