/// Ensures that the given term is a universe, returning the level of that
/// universe and its elaborated form.
Ensures that the given term is a universe, returning the level of that
universe and its elaborated form.
Ensures that the given term is a universe returning the level of that universe and its elaborated form .
pub fn synth_universe(
    context: &Context,
    metas: &mut meta::Env,
    concrete_term: &Term<'_>,
) -> Result<(Rc<syntax::Term>, UniverseLevel), Diagnostic<FileSpan>> {
    let (term, ty) = synth_term(MetaInsertion::Yes, context, metas, concrete_term)?;
    match ty.as_ref() {
        domain::Value::Universe(level) => Ok((term, *level)),
        _ => Err(Diagnostic::new_error("type expected").with_label(
            DiagnosticLabel::new_primary(concrete_term.span()).with_message(format!(
                "found `{}`",
                context.value_to_doc(metas, &ty).pretty(1000_000_000),
            )),
        )),
    }
}
pub fn synth_universe ( context : & Context , metas : & mut meta :: Env , concrete_term : & Term < ' _ > , ) -> Result < ( Rc < syntax :: Term > , UniverseLevel ) , Diagnostic < FileSpan > > { let ( term , ty ) = synth_term ( MetaInsertion :: Yes , context , metas , concrete_term ) ? ; match ty . as_ref ( ) { domain :: Value :: Universe ( level ) => Ok ( ( term , * level ) ) , _ => Err ( Diagnostic :: new_error ( " " ) . with_label ( DiagnosticLabel :: new_primary ( concrete_term . span ( ) ) . with_message ( format ! ( " " context value_to_doc ( metas ty ) pretty ( 1000_000_000 ) ) ) , ) ) , } }
Ensures that the given term is a universe, returning the level of that
universe and its elaborated form.
Ensures that the given term is a universe returning the level of that universe and its elaborated form .
context
&Context
metas
&mut meta::Env
concrete_term
&Term<'_>