mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Merge branch 'trunk' into incompatible_type_param
This commit is contained in:
commit
b35eb85e03
2 changed files with 27 additions and 10 deletions
|
@ -4131,17 +4131,17 @@ fn convert_tag_union<'a>(
|
|||
hole,
|
||||
),
|
||||
ByteUnion(tag_names) => {
|
||||
let tag_id = tag_names
|
||||
.iter()
|
||||
.position(|key| key == &tag_name)
|
||||
.expect("tag must be in its own type");
|
||||
let opt_tag_id = tag_names.iter().position(|key| key == &tag_name);
|
||||
|
||||
Stmt::Let(
|
||||
assigned,
|
||||
Expr::Literal(Literal::Byte(tag_id as u8)),
|
||||
Layout::Builtin(Builtin::Int8),
|
||||
hole,
|
||||
)
|
||||
match opt_tag_id {
|
||||
Some(tag_id) => Stmt::Let(
|
||||
assigned,
|
||||
Expr::Literal(Literal::Byte(tag_id as u8)),
|
||||
Layout::Builtin(Builtin::Int8),
|
||||
hole,
|
||||
),
|
||||
None => Stmt::RuntimeError("tag must be in its own type"),
|
||||
}
|
||||
}
|
||||
|
||||
Newtype {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue