mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
make newtype wrappers explicit in pattern code
This commit is contained in:
parent
01f6433556
commit
61c9de91dc
4 changed files with 205 additions and 86 deletions
|
@ -279,7 +279,7 @@ impl<'a> LambdaSet<'a> {
|
|||
Unit | UnitWithArguments => Layout::Struct(&[]),
|
||||
BoolUnion { .. } => Layout::Builtin(Builtin::Int1),
|
||||
ByteUnion(_) => Layout::Builtin(Builtin::Int8),
|
||||
Unwrapped {
|
||||
Newtype {
|
||||
arguments: layouts, ..
|
||||
} => Layout::Struct(layouts.into_bump_slice()),
|
||||
Wrapped(variant) => {
|
||||
|
@ -1285,7 +1285,7 @@ pub enum UnionVariant<'a> {
|
|||
ffalse: TagName,
|
||||
},
|
||||
ByteUnion(Vec<'a, TagName>),
|
||||
Unwrapped {
|
||||
Newtype {
|
||||
tag_name: TagName,
|
||||
arguments: Vec<'a, Layout<'a>>,
|
||||
},
|
||||
|
@ -1506,7 +1506,7 @@ pub fn union_sorted_tags_help<'a>(
|
|||
fields: layouts.into_bump_slice(),
|
||||
})
|
||||
} else {
|
||||
UnionVariant::Unwrapped {
|
||||
UnionVariant::Newtype {
|
||||
tag_name,
|
||||
arguments: layouts,
|
||||
}
|
||||
|
@ -1661,7 +1661,7 @@ pub fn layout_from_tag_union<'a>(
|
|||
Unit | UnitWithArguments => Layout::Struct(&[]),
|
||||
BoolUnion { .. } => Layout::Builtin(Builtin::Int1),
|
||||
ByteUnion(_) => Layout::Builtin(Builtin::Int8),
|
||||
Unwrapped {
|
||||
Newtype {
|
||||
arguments: mut field_layouts,
|
||||
..
|
||||
} => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue