feat: add as type casting

This commit is contained in:
2026-04-22 22:40:19 +02:00
parent e66a4ee736
commit 041a49e574
13 changed files with 350 additions and 1 deletions
+14
View File
@@ -385,6 +385,20 @@ impl FuncBuilder {
rval_op
}
TypedExprKind::Cast {
expr: inner,
ty: target_ty,
} => {
let inner_op = self.lower_expr(inner);
let temp = self.new_temp(target_ty.clone());
self.emit_stmt(Statement {
kind: StatementKind::Assign(temp, Rvalue::Cast(target_ty.clone(), inner_op)),
span: expr.span,
});
Operand::Copy(temp)
}
}
}
}