mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Merge remote-tracking branch 'origin/trunk' into reset-reuse
This commit is contained in:
commit
e02d950c7c
50 changed files with 2387 additions and 992 deletions
|
@ -208,6 +208,15 @@ impl<'a> UnionLayout<'a> {
|
|||
UnionLayout::NullableUnwrapped { nullable_id, .. } => *nullable_id == (tag_id != 0),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_nullable(&self) -> bool {
|
||||
match self {
|
||||
UnionLayout::NonRecursive(_)
|
||||
| UnionLayout::Recursive(_)
|
||||
| UnionLayout::NonNullableUnwrapped { .. } => false,
|
||||
UnionLayout::NullableWrapped { .. } | UnionLayout::NullableUnwrapped { .. } => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue