fix the inference on itf

This commit is contained in:
Jakub Doka 2024-11-15 22:53:22 +01:00
parent 12be64965f
commit b1b6d9eba1
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -3307,7 +3307,7 @@ impl<'a> Codegen<'a> {
)) ))
} }
Expr::Directive { name: "itf", args: [expr], .. } => { 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() { let (ret_ty, expected) = match val.ty.simple_size().unwrap() {
8 => (ty::Id::F64, ty::Id::INT), 8 => (ty::Id::F64, ty::Id::INT),