mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
int cast
This commit is contained in:
parent
128741e585
commit
43e71f2ee9
6 changed files with 27 additions and 1 deletions
|
@ -3983,6 +3983,16 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
op,
|
||||
)
|
||||
}
|
||||
NumIntCast => {
|
||||
debug_assert_eq!(args.len(), 1);
|
||||
|
||||
let arg = load_symbol(scope, &args[0]).into_int_value();
|
||||
|
||||
let to = basic_type_from_layout(env.arena, env.context, layout, env.ptr_bytes)
|
||||
.into_int_type();
|
||||
|
||||
env.builder.build_int_cast(arg, to, "inc_cast").into()
|
||||
}
|
||||
Eq => {
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue