all the instance and value decls. Indeed that's the reason we need
two passes over the instance decls.
-
Here is the overall algorithm.
Assume that we have an instance declaration
-- Type-check all the stuff before the "where"
--
-- We check for respectable instance type, and context
-tcLocalInstDecl1 decl@(L loc (InstDecl poly_ty binds uprags))
+tcLocalInstDecl1 decl@(L loc (InstDecl poly_ty binds uprags ats))
= -- Prime error recovery, set source location
+ ASSERT( null ats )
+ -- !!!TODO: Handle the `ats' parameter!!! -=chak
recoverM (returnM Nothing) $
setSrcSpan loc $
addErrCtxt (instDeclCtxt1 poly_ty) $
let
prag_fn = mkPragFun uprags
all_insts = avail_insts ++ catMaybes meth_insts
- tc_method_bind = tcMethodBind inst_tyvars' dfun_theta' all_insts prag_fn
+ sig_fn n = Just [] -- No scoped type variables, but every method has
+ -- a type signature, in effect, so that we check
+ -- the method has the right type
+ tc_method_bind = tcMethodBind inst_tyvars' dfun_theta' all_insts sig_fn prag_fn
meth_ids = [meth_id | (_,meth_id,_) <- meth_infos]
in