[commit: ghc] wip/exp-types: Tiny refactoring in TcUnify (c89c990)

git at git.haskell.org git at git.haskell.org
Thu Jan 14 04:29:45 UTC 2016


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

On branch  : wip/exp-types
Link       : http://ghc.haskell.org/trac/ghc/changeset/c89c9903a093e979b875dfdd2099d846fad21fc1/ghc

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

commit c89c9903a093e979b875dfdd2099d846fad21fc1
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Mon Jan 11 21:28:24 2016 -0500

    Tiny refactoring in TcUnify


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

c89c9903a093e979b875dfdd2099d846fad21fc1
 compiler/typecheck/TcUnify.hs | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs
index 908b692..20636bf 100644
--- a/compiler/typecheck/TcUnify.hs
+++ b/compiler/typecheck/TcUnify.hs
@@ -677,8 +677,10 @@ tc_sub_type_ds eq_orig inst_orig ctxt ty_actual ty_expected
       = inst_and_unify
          -- It's still possible that ty_actual has nested foralls. Instantiate
          -- these, as there's no way unification will succeed with them in.
-         -- See typecheck/should_compiler/T11350 for an example of when this
-         -- is important.
+         -- See typecheck/should_compile/T11305 for an example of when this
+         -- is important. The problem is that we're checking something like
+         --  a -> forall b. b -> b     <=   alpha beta gamma
+         -- where we end up with alpha := (->)
 
     inst_and_unify = do { (wrap, rho_a) <- deeplyInstantiate inst_orig ty_actual
 
@@ -693,10 +695,7 @@ tc_sub_type_ds eq_orig inst_orig ctxt ty_actual ty_expected
                                              , uo_thing    = thing }
                                   |  orig_ty_actual `tcEqType` ty_actual
                                   ,  not (isIdHsWrapper wrap)
-                                  -> TypeEqOrigin
-                                       { uo_actual = rho_a
-                                       , uo_expected = orig_ty_expected
-                                       , uo_thing    = thing }
+                                  -> eq_orig { uo_actual = rho_a }
                                 _ -> eq_orig
 
                         ; cow <- uType eq_orig' TypeLevel rho_a ty_expected



More information about the ghc-commits mailing list