[commit: ghc] wip/tc/typeable-with-kinds: Custom treatment of `Typeable` in super-classes. (379d627)
git at git.haskell.org
git at git.haskell.org
Sat Mar 7 16:43:26 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/tc/typeable-with-kinds
Link : http://ghc.haskell.org/trac/ghc/changeset/379d6273717157c3ec1ce3daea621d8243103438/ghc
>---------------------------------------------------------------
commit 379d6273717157c3ec1ce3daea621d8243103438
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.
>---------------------------------------------------------------
379d6273717157c3ec1ce3daea621d8243103438
compiler/typecheck/TcInstDcls.hs | 1 +
1 file changed, 1 insertion(+)
diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs
index 5ee6479..fb3b466 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