mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
make ir use different tag id types
This commit is contained in:
parent
0d07c2ef84
commit
1d1bcaea63
4 changed files with 25 additions and 14 deletions
|
@ -159,12 +159,23 @@ impl<'a> UnionLayout<'a> {
|
|||
Self::BIGGEST_TAG_ID_TYPE
|
||||
}
|
||||
|
||||
pub fn tag_id_layout(&self) -> Option<Layout<'a>> {
|
||||
pub fn tag_id_layout(&self) -> Layout<'a> {
|
||||
match self {
|
||||
UnionLayout::NonRecursive(_)
|
||||
| UnionLayout::Recursive(_)
|
||||
| UnionLayout::NullableWrapped { .. } => Some(Self::BIGGEST_TAG_ID_TYPE),
|
||||
UnionLayout::NonNullableUnwrapped(_) | UnionLayout::NullableUnwrapped { .. } => None,
|
||||
| UnionLayout::NullableWrapped { .. } => Self::BIGGEST_TAG_ID_TYPE,
|
||||
UnionLayout::NonNullableUnwrapped(_) | UnionLayout::NullableUnwrapped { .. } => {
|
||||
Self::BIGGEST_TAG_ID_TYPE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn stores_tag_id(&self) -> bool {
|
||||
match self {
|
||||
UnionLayout::NonRecursive(_)
|
||||
| UnionLayout::Recursive(_)
|
||||
| UnionLayout::NullableWrapped { .. } => true,
|
||||
UnionLayout::NonNullableUnwrapped(_) | UnionLayout::NullableUnwrapped { .. } => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue