mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
make tag id less hardcoded
This commit is contained in:
parent
3e53f0a14d
commit
0d07c2ef84
3 changed files with 52 additions and 29 deletions
|
@ -153,11 +153,17 @@ impl<'a> UnionLayout<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
const BIGGEST_TAG_ID_TYPE: Layout<'static> = Layout::Builtin(Builtin::Int64);
|
||||
|
||||
pub fn tag_id_layout_from_slices(_slices: &[&[Layout<'a>]]) -> Layout<'a> {
|
||||
Self::BIGGEST_TAG_ID_TYPE
|
||||
}
|
||||
|
||||
pub fn tag_id_layout(&self) -> Option<Layout<'a>> {
|
||||
match self {
|
||||
UnionLayout::NonRecursive(_)
|
||||
| UnionLayout::Recursive(_)
|
||||
| UnionLayout::NullableWrapped { .. } => Some(Layout::Builtin(Builtin::Int64)),
|
||||
| UnionLayout::NullableWrapped { .. } => Some(Self::BIGGEST_TAG_ID_TYPE),
|
||||
UnionLayout::NonNullableUnwrapped(_) | UnionLayout::NullableUnwrapped { .. } => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue