mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
use in decision_tree
This commit is contained in:
parent
7f51bf77aa
commit
3a6ef8a53d
9 changed files with 111 additions and 76 deletions
|
@ -856,14 +856,24 @@ fn expr_spec(
|
|||
Struct(fields) => build_tuple_value(builder, env, block, fields),
|
||||
CoerceToTagId {
|
||||
index,
|
||||
union_layout,
|
||||
tag_id,
|
||||
structure,
|
||||
} => {
|
||||
let value_id = env.symbols[structure];
|
||||
let result_type = layout_spec(builder, layout)?;
|
||||
builder.add_unknown_with(block, &[value_id], result_type)
|
||||
}
|
||||
union_layout,
|
||||
} => match union_layout {
|
||||
UnionLayout::NonRecursive(_) => {
|
||||
let tag_value_id = env.symbols[structure];
|
||||
let tuple_value_id =
|
||||
builder.add_unwrap_union(block, tag_value_id, *tag_id as u32)?;
|
||||
|
||||
builder.add_get_tuple_field(block, tuple_value_id, *index as u32)
|
||||
}
|
||||
_ => {
|
||||
// for the moment recursive tag unions don't quite work
|
||||
let value_id = env.symbols[structure];
|
||||
let result_type = layout_spec(builder, layout)?;
|
||||
builder.add_unknown_with(block, &[value_id], result_type)
|
||||
}
|
||||
},
|
||||
AccessAtIndex {
|
||||
index,
|
||||
field_layouts: _,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue