Beispiel #1
0
 virtual expr check_type(expr const & m, abstract_type_context & ctx, bool infer_only) const {
     check_macro(m);
     expr given_type = macro_arg(m, 0);
     if (!infer_only) {
         ctx.check(given_type, infer_only);
         expr inferred_type = ctx.check(macro_arg(m, 1), infer_only);
         if (!ctx.is_def_eq(inferred_type, given_type)) {
             throw_kernel_exception(ctx.env(), m, [=](formatter const & fmt) {
                 return format("type mismatch at term") + pp_type_mismatch(fmt, macro_arg(m, 1), inferred_type, given_type);
             });
         }
     }
     return given_type;
 }