diff --git a/src/frontend.rs b/src/frontend.rs index d8da2c2..dd1aeef 100644 --- a/src/frontend.rs +++ b/src/frontend.rs @@ -292,7 +292,7 @@ impl Context { return expr.clone(); } match &expr.kind { - typed_ir::ExprKind::Literal(_) => todo!(), + typed_ir::ExprKind::Literal(lit) => expr.clone().with_type(lit.typ), // we can not see beyond this expression right now typed_ir::ExprKind::Path(_) => expr.clone(), typed_ir::ExprKind::Call { @@ -372,7 +372,11 @@ impl Context { expr: &typed_ir::Expr, ) -> std::fmt::Result { let expr_pretty = match &expr.kind { - typed_ir::ExprKind::Literal(_) => todo!(), + typed_ir::ExprKind::Literal(lit) => { + let mut lit_str = String::new(); + self.types.pretty_value(&mut lit_str, lit)?; + lit_str + } typed_ir::ExprKind::Path(path) => format!("sig_{}", path.0), typed_ir::ExprKind::Call { called, diff --git a/src/frontend/types.rs b/src/frontend/types.rs index 50e1951..0948983 100644 --- a/src/frontend/types.rs +++ b/src/frontend/types.rs @@ -43,7 +43,7 @@ pub struct FnSig { #[derive(Debug, Clone)] pub struct ElabData { - typ: Type, + pub typ: Type, value: ElabValue, }