From f238dae7ded41a7af20b6c0bc70e90e1ed8dffd9 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 17 Apr 2003 15:22:41 +0000 Subject: [PATCH] [project @ 2003-04-17 15:22:38 by simonpj] Comments --- ghc/compiler/typecheck/TcClassDcl.lhs | 9 +-------- ghc/compiler/typecheck/TcInstDcls.lhs | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/ghc/compiler/typecheck/TcClassDcl.lhs b/ghc/compiler/typecheck/TcClassDcl.lhs index d0bdc5e..820ed74 100644 --- a/ghc/compiler/typecheck/TcClassDcl.lhs +++ b/ghc/compiler/typecheck/TcClassDcl.lhs @@ -372,14 +372,7 @@ tcDefMeth clas tyvars binds_in prags (_, GenDefMeth) = returnM (EmptyMonoBinds, 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 diff --git a/ghc/compiler/typecheck/TcInstDcls.lhs b/ghc/compiler/typecheck/TcInstDcls.lhs index 6b17d3a..d35c0de 100644 --- a/ghc/compiler/typecheck/TcInstDcls.lhs +++ b/ghc/compiler/typecheck/TcInstDcls.lhs @@ -489,7 +489,7 @@ tcInstDecl2 (InstInfo { iDFunId = dfun_id, iBinds = binds }) 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 -- 1.7.10.4