[commit: ghc] wip/impredicativity: Check whether a variable is filled in defaulting of <~ (ef62258)

git at git.haskell.org git at git.haskell.org
Fri Jul 24 14:26:29 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/impredicativity
Link       : http://ghc.haskell.org/trac/ghc/changeset/ef62258a1eae067545c464755d8f866ec6dcc466/ghc

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

commit ef62258a1eae067545c464755d8f866ec6dcc466
Author: Alejandro Serrano <trupill at gmail.com>
Date:   Thu Jul 23 08:43:26 2015 +0200

    Check whether a variable is filled in defaulting of <~


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

ef62258a1eae067545c464755d8f866ec6dcc466
 compiler/typecheck/TcSimplify.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs
index 1bc3701..fd0d20d 100644
--- a/compiler/typecheck/TcSimplify.hs
+++ b/compiler/typecheck/TcSimplify.hs
@@ -136,8 +136,10 @@ simpl_top wanteds
                case (isWantedCt ct, classifyPredType (ctPred ct)) of
                  (True, InstanceOfPred lhs rhs)
                    | Just v <- tcGetTyVar_maybe rhs
-                   -> do { unifyTyVar v lhs
-                         ; return True }
+                   -> do { filled <- TcS.isFilledMetaTyVar v
+                         ; if filled
+                              then return False
+                              else unifyTyVar v lhs >> return True }
                  _ -> return something) False approx
            ; if something_happened
              then do { wc_residual <- nestTcS (solveWantedsAndDrop wc)



More information about the ghc-commits mailing list