mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Fixed erased with nullable unwrapped union
This commit is contained in:
parent
5e9a06e537
commit
937e042c8f
4 changed files with 105 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
use roc_target::TargetInfo;
|
||||
|
||||
use super::{InLayout, LayoutRepr};
|
||||
use super::{InLayout, LayoutRepr, UnionLayout};
|
||||
|
||||
/// The layout of an erasure.
|
||||
///
|
||||
|
@ -56,11 +56,17 @@ impl Erased {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> LayoutRepr<'a> {
|
||||
pub fn boxed_erased_value(value: &'a InLayout<'a>) -> Self {
|
||||
Self::Union(super::UnionLayout::NullableUnwrapped {
|
||||
impl<'a> UnionLayout<'a> {
|
||||
pub(crate) fn boxed_erased_value(value: &'a InLayout<'a>) -> Self {
|
||||
UnionLayout::NullableUnwrapped {
|
||||
nullable_id: true,
|
||||
other_fields: std::slice::from_ref(value),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> LayoutRepr<'a> {
|
||||
pub(crate) fn boxed_erased_value(value: &'a InLayout<'a>) -> Self {
|
||||
Self::Union(UnionLayout::boxed_erased_value(value))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue