mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
refactor
This commit is contained in:
parent
e27a12e644
commit
3e387e8328
2 changed files with 447 additions and 470 deletions
|
@ -152,6 +152,15 @@ impl<'a> UnionLayout<'a> {
|
|||
result
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tag_id_layout(&self) -> Option<Layout<'a>> {
|
||||
match self {
|
||||
UnionLayout::NonRecursive(_)
|
||||
| UnionLayout::Recursive(_)
|
||||
| UnionLayout::NullableWrapped { .. } => Some(Layout::Builtin(Builtin::Int64)),
|
||||
UnionLayout::NonNullableUnwrapped(_) | UnionLayout::NullableUnwrapped { .. } => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue