@@ -554,15 +554,20 @@ elabClass info syn fc constraints tn ps ds
554554 let constraint = PApp fc (PRef fc tn)
555555 (map (pexp . PRef fc) (map fst ps))
556556 -- build data declaration
557− ims <- mapM tdecl (filter tydecl ds)
557+ let mdecls = filter tydecl ds -- method declarations
558+ let mnames = map getMName mdecls
559+ logLvl 2 $ "Building methods " ++ show mnames
560+ ims <- mapM (tdecl mnames) mdecls
558561 defs <- mapM (defdecl (map (\ (x,y,z) -> z) ims) constraint)
559562 (filter clause ds)
560563 let (methods, imethods) = unzip (map (\ (x,y,z) -> (x, y)) ims)
561564 let cty = impbind ps $ conbind constraints $ pibind methods constraint
562565 let cons = [(cn, cty, fc)]
563− let ddecl = PData syn fc (PDatadecl tn tty cons)
564− elabDecl info ddecl
566+ let ddecl = PDatadecl tn tty cons
567+ logLvl 5 $ "Class data " ++ showDImp True ddecl
568+ elabData info (syn { no_imp = no_imp syn ++ mnames }) fc ddecl
565569 -- for each constraint, build a top level function to chase it
570+ logLvl 5 $ "Building functions"
566571 let usyn = syn { using = ps ++ using syn }
567572 fns <- mapM (cfun cn constraint usyn (map fst imethods)) constraints
568573 mapM_ (elabDecl info) (concat fns)
@@ -583,11 +588,14 @@ elabClass info syn fc constraints tn ps ds
583588 conbind (ty : ns) x = PPi constraint (MN 0 "c") ty (conbind ns x)
584589 conbind [] x = x
585590
586− tdecl (PTy syn _ o n t) = do t' <- implicit syn n t
587− return ( (n, (toExp (map fst ps) Exp t')),
588− (n, (o, (toExp (map fst ps) Imp t'))),
589− (n, (syn, o, t) ) )
590− tdecl _ = fail "Not allowed in a class declaration"
591+ getMName (PTy _ _ _ n _) = nsroot n
592+ tdecl allmeths (PTy syn _ o n t)
593+ = do t' <- implicit' syn allmeths n t
594+ logLvl 5 $ "Method " ++ show n ++ " : " ++ showImp True t'
595+ return ( (n, (toExp (map fst ps) Exp t')),
596+ (n, (o, (toExp (map fst ps) Imp t'))),
597+ (n, (syn, o, t) ) )
598+ tdecl _ _ = fail "Not allowed in a class declaration"
591599
592600 -- Create default definitions
593601 defdecl mtys c d@(PClauses fc opts n cs) =