mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Don't assume tag id is in the tag arguments in making decision tree
This commit is contained in:
parent
a9b02aed5e
commit
d6669aed2e
1 changed files with 2 additions and 5 deletions
|
@ -9698,8 +9698,7 @@ fn from_can_pattern_help<'a>(
|
||||||
ctors.push(Ctor {
|
ctors.push(Ctor {
|
||||||
tag_id: TagId(i as _),
|
tag_id: TagId(i as _),
|
||||||
name: CtorName::Tag(tag_name.expect_tag_ref().clone()),
|
name: CtorName::Tag(tag_name.expect_tag_ref().clone()),
|
||||||
// don't include tag discriminant in arity
|
arity: args.len(),
|
||||||
arity: args.len() - 1,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9855,8 +9854,7 @@ fn from_can_pattern_help<'a>(
|
||||||
ctors.push(Ctor {
|
ctors.push(Ctor {
|
||||||
tag_id: TagId(!nullable_id as _),
|
tag_id: TagId(!nullable_id as _),
|
||||||
name: CtorName::Tag(nullable_name.expect_tag_ref().clone()),
|
name: CtorName::Tag(nullable_name.expect_tag_ref().clone()),
|
||||||
// FIXME drop tag
|
arity: other_fields.len(),
|
||||||
arity: other_fields.len() - 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let union = roc_exhaustive::Union {
|
let union = roc_exhaustive::Union {
|
||||||
|
@ -9869,7 +9867,6 @@ fn from_can_pattern_help<'a>(
|
||||||
let it = if tag_name == nullable_name.expect_tag_ref() {
|
let it = if tag_name == nullable_name.expect_tag_ref() {
|
||||||
[].iter()
|
[].iter()
|
||||||
} else {
|
} else {
|
||||||
// FIXME drop tag
|
|
||||||
argument_layouts.iter()
|
argument_layouts.iter()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue