X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FMkIface.lhs;fp=ghc%2Fcompiler%2Fmain%2FMkIface.lhs;h=502547341d72e37f464dcc596552e06dad46a2a3;hb=4e84be0ce335385e094ba12d284855b510a36f53;hp=b4178dbfe0cee609a695a2b183065195f62bba43;hpb=fa654d6b16ecda7cc8cb780792ca10ec0e227555;p=ghc-hetmet.git diff --git a/ghc/compiler/main/MkIface.lhs b/ghc/compiler/main/MkIface.lhs index b4178db..5025473 100644 --- a/ghc/compiler/main/MkIface.lhs +++ b/ghc/compiler/main/MkIface.lhs @@ -55,7 +55,7 @@ import TyCon ( DataConDetails(..), tyConTyVars, tyConDataCons, tyConTheta, getSynTyConDefn, tyConGenInfo, tyConDataConDetails, tyConArity ) import Class ( classExtraBigSig, classTyCon, DefMeth(..) ) import FieldLabel ( fieldLabelType ) -import TcType ( tcSplitSigmaTy, tidyTopType, deNoteType, tyClsNamesOfDFunHead ) +import TcType ( tcSplitForAllTys, tcFunResultTy, tidyTopType, deNoteType, tyClsNamesOfDFunHead ) import SrcLoc ( noSrcLoc ) import Module ( Module, ModuleName, moduleNameFS, moduleName, isHomeModule, ModLocation(..), mkSysModuleNameFS, @@ -248,7 +248,13 @@ ifaceTyThing (AClass clas) = cls_decl = ASSERT(sel_tyvars == clas_tyvars) ClassOpSig (getName sel_id) def_meth' (toHsType op_ty) noSrcLoc where - (sel_tyvars, _, op_ty) = tcSplitSigmaTy (idType sel_id) + -- Be careful when splitting the type, because of things + -- like class Foo a where + -- op :: (?x :: String) => a -> a + -- and class Baz a where + -- op :: (Ord a) => a -> a + (sel_tyvars, rho_ty) = tcSplitForAllTys (idType sel_id) + op_ty = tcFunResultTy rho_ty def_meth' = case def_meth of NoDefMeth -> NoDefMeth GenDefMeth -> GenDefMeth