From 3a5c9d485332748d9ea85ae99d24adcf810d9788 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Wed, 20 Apr 2011 12:56:41 +0100 Subject: [PATCH] Make TcClassDcl compile --- compiler/typecheck/TcClassDcl.lhs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcClassDcl.lhs b/compiler/typecheck/TcClassDcl.lhs index 2e93e90..17b6644 100644 --- a/compiler/typecheck/TcClassDcl.lhs +++ b/compiler/typecheck/TcClassDcl.lhs @@ -19,6 +19,7 @@ import RnHsSyn import Inst import InstEnv import TcEnv +import TcPat( addInlinePrags ) import TcBinds import TcUnify import TcHsType @@ -207,11 +208,11 @@ tcDefMeth clas tyvars this_dict binds_in sigs sig_fn prag_fn (sel_id, dm_info) `orElse` pprPanic "tcDefMeth" (ppr sel_id) dm_sig_fn _ = sig_fn sel_name - dm_prag_fn _ = prag_fn sel_name + prags = prag_fn sel_name - dm_ty = mkSigmaTy tyvars [mkClassPred clas tyvars] local_dm_ty + dm_ty = mkSigmaTy tyvars [mkClassPred clas (mkTyVarTys tyvars)] local_dm_ty dm_id = mkExportedLocalId dm_name dm_ty - local_dm_id = mkLocalId local_dm_name local_dm_type + local_dm_id = mkLocalId local_dm_name local_dm_ty ; dm_id_w_inline <- addInlinePrags dm_id prags ; spec_prags <- tcSpecPrags dm_id prags @@ -222,7 +223,7 @@ tcDefMeth clas tyvars this_dict binds_in sigs sig_fn prag_fn (sel_id, dm_info) ; dm_bind <- tcInstanceMethodBody (ClsSkol clas) tyvars [this_dict] dm_id_w_inline local_dm_id dm_sig_fn - IsDefaultMethodId dm_bind + IsDefaultMethod meth_bind ; return (unitBag dm_bind) } @@ -233,7 +234,7 @@ tcDefMeth clas tyvars this_dict binds_in sigs sig_fn prag_fn (sel_id, dm_info) ; checkValidType (FunSigCtxt sel_name) tau ; return tau } -findGenericSig :: [LSig Name] -> Name -> LSig Name +findGenericSig :: [LSig Name] -> Name -> LHsType Name -- Find the 'generic op :: ty' signature among the sigs -- If dm_info is GenDefMeth, the corresponding signature -- should jolly well exist! Hence the panic -- 1.7.10.4