tcDefMeth clas tyvars binds_in prags op_item@(sel_id, DefMeth dm_name)
= tcInstTyVars ClsTv tyvars `thenM` \ (clas_tyvars, inst_tys, _) ->
let
- dm_ty = idType sel_id -- Same as dict selector!
- -- The default method's type should really come from the
- -- iface file, since it could be usage-generalised, but this
- -- requires altering the mess of knots in TcModule and I'm
- -- too scared to do that. Instead, I have disabled generalisation
- -- of types of default methods (and dict funs) by annotating them
- -- TyGenNever (in MkId). Ugh! KSW 1999-09.
-
+ dm_ty = idType sel_id -- Same as dict selector!
theta = [mkClassPred clas inst_tys]
local_dm_id = mkDefaultMethodId dm_name dm_ty
xtve = tyvars `zip` clas_tyvars
addSrcLoc (getSrcLoc dfun_id) $
addErrCtxt (instDeclCtxt (toHsType (idType dfun_id))) $
let
- inst_ty = idType dfun_id
+ inst_ty = idType dfun_id
(inst_tyvars, _) = tcSplitForAllTys inst_ty
-- The tyvars of the instance decl scope over the 'where' part
-- Those tyvars are inside the dfun_id's type, which is a bit