mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
add alloca as an expression
This commit is contained in:
parent
750234f2de
commit
cdd2aab217
15 changed files with 171 additions and 14 deletions
|
@ -1584,6 +1584,16 @@ fn expr_spec<'a>(
|
|||
|
||||
builder.add_make_tuple(block, &[])
|
||||
}
|
||||
Alloca { initializer, .. } => {
|
||||
let initializer = &initializer.as_ref().map(|s| env.symbols[s]);
|
||||
let values = match initializer {
|
||||
Some(initializer) => std::slice::from_ref(initializer),
|
||||
None => &[],
|
||||
};
|
||||
|
||||
let type_id = layout_spec(env, builder, interner, interner.get_repr(layout))?;
|
||||
builder.add_unknown_with(block, values, type_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue