From b1b6d9eba13959a517c569dec8a954186f5e2d32 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Fri, 15 Nov 2024 22:53:22 +0100 Subject: [PATCH] fix the inference on itf --- lang/src/son.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/src/son.rs b/lang/src/son.rs index 608bf3e..8a29840 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -3307,7 +3307,7 @@ impl<'a> Codegen<'a> { )) } Expr::Directive { name: "itf", args: [expr], .. } => { - let mut val = self.expr(expr)?; + let mut val = self.expr_ctx(expr, Ctx::default().with_ty(ty::Id::INT))?; let (ret_ty, expected) = match val.ty.simple_size().unwrap() { 8 => (ty::Id::F64, ty::Id::INT),