/// Synthesize the type of the body of a clause, and elaborate it.
Synthesize the type of the body of a clause, and elaborate it.
Synthesize the type of the body of a clause and elaborate it .
fn synth_clause_body(
    context: &Context,
    metas: &mut meta::Env,
    clause: &Clause<'_>,
) -> Result<(Rc<syntax::Term>, Rc<domain::Type>), Diagnostic<FileSpan>> {
    match clause.body_ty {
        None => synth_term(MetaInsertion::Yes, context, metas, clause.body),
        Some(body_ty) => {
            let body_ty_span = body_ty.span();
            let (body_ty, _) = synth_universe(context, metas, body_ty)?;
            let body_ty_value = context.eval_term(metas, body_ty_span, &body_ty)?;
            let body = check_term(context, metas, clause.body, &body_ty_value)?;
            Ok((Rc::from(syntax::Term::ann(body, body_ty)), body_ty_value))
        },
    }
}
fn synth_clause_body ( context : & Context , metas : & mut meta :: Env , clause : & Clause < ' _ > , ) -> Result < ( Rc < syntax :: Term > , Rc < domain :: Type > ) , Diagnostic < FileSpan > > { match clause . body_ty { None => synth_term ( MetaInsertion :: Yes , context , metas , clause . body ) , Some ( body_ty ) => { let body_ty_span = body_ty . span ( ) ; let ( body_ty , _ ) = synth_universe ( context , metas , body_ty ) ? ; let body_ty_value = context . eval_term ( metas , body_ty_span , & body_ty ) ? ; let body = check_term ( context , metas , clause . body , & body_ty_value ) ? ; Ok ( ( Rc :: from ( syntax :: Term :: ann ( body , body_ty ) ) , body_ty_value ) ) } , } }
Synthesize the type of the body of a clause, and elaborate it.
Synthesize the type of the body of a clause and elaborate it .
context
&Context
metas
&mut meta::Env
clause
&Clause<'_>