From d26718ec661a1bcc244766ff64d9072ffb4e2170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Sat, 21 Sep 2024 11:23:08 +0200 Subject: [PATCH] Fix --- src/monomorph.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/monomorph.rs b/src/monomorph.rs index 4f7ecc8..c046dcb 100644 --- a/src/monomorph.rs +++ b/src/monomorph.rs @@ -557,7 +557,14 @@ fn mono_expr( ast::Expr::Char(*char) } - ast::Expr::Constr(_) | ast::Expr::Self_ => expr.clone(), + ast::Expr::Constr(constr) => { + let ty_decl = poly_pgm.ty.get(constr).unwrap(); + let mono_constr = mono_ty_decl(ty_decl, &[], poly_pgm, mono_pgm); + debug_assert_eq!(&mono_constr, constr); + ast::Expr::Constr(mono_constr) + } + + ast::Expr::Self_ => ast::Expr::Self_, ast::Expr::Call(ast::CallExpr { fun, args }) => ast::Expr::Call(ast::CallExpr { fun: mono_bl_expr(fun, ty_map, poly_pgm, mono_pgm),