This commit is contained in:
Folkert 2021-06-27 15:08:57 +02:00
parent e27a12e644
commit 3e387e8328
2 changed files with 447 additions and 470 deletions

View file

@ -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)]