[project @ 2003-04-17 15:22:38 by simonpj]
authorsimonpj <unknown>
Thu, 17 Apr 2003 15:22:41 +0000 (15:22 +0000)
committersimonpj <unknown>
Thu, 17 Apr 2003 15:22:41 +0000 (15:22 +0000)
Comments

ghc/compiler/typecheck/TcClassDcl.lhs
ghc/compiler/typecheck/TcInstDcls.lhs

index d0bdc5e..820ed74 100644 (file)
@@ -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
index 6b17d3a..d35c0de 100644 (file)
@@ -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