[commit: ghc] typeable-with-kinds: Custom treatment of `Typeable` in super-classes. (4b4005e)

git at git.haskell.org git at git.haskell.org
Wed Feb 11 02:14:18 UTC 2015


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

On branch  : typeable-with-kinds
Link       : http://ghc.haskell.org/trac/ghc/changeset/4b4005ed31a39d9d28daaf5a966af36a0b1f3a61/ghc

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

commit 4b4005ed31a39d9d28daaf5a966af36a0b1f3a61
Author: Iavor S. Diatchki <diatchki at galois.com>
Date:   Tue Feb 10 17:35:01 2015 -0800

    Custom treatment of `Typeable` in super-classes.
    
    It would appear that GHC "short-cuts" the solver when it encounters
    super-class constraints that look like classes.
    
    This means that the custom solvers in TcInteract do not work!
    This does not seem quite right, but until we fix it, we have
    an explicit check to pass on `Typeable` to the constraint solver.


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

4b4005ed31a39d9d28daaf5a966af36a0b1f3a61
 compiler/typecheck/TcInstDcls.hs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs
index 4444101..7f980c2 100644
--- a/compiler/typecheck/TcInstDcls.hs
+++ b/compiler/typecheck/TcInstDcls.hs
@@ -1068,6 +1068,7 @@ tcSuperClasses dfun_id cls tyvars dfun_evs inst_tys dfun_ev_binds fam_envs sc_th
       | (sc_co, norm_sc_pred) <- normaliseType fam_envs Nominal sc_pred
                                  -- sc_co :: sc_pred ~ norm_sc_pred
       , ClassPred cls tys <- classifyPredType norm_sc_pred
+      , className cls /= typeableClassName
       = do { sc_ev_tm <- emit_sc_cls_pred norm_sc_pred cls tys
            ; sc_ev_id <- newEvVar sc_pred
            ; let tc_co = TcCoercion (mkSubCo (mkSymCo sc_co))



More information about the ghc-commits mailing list