feat: add as type casting
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user