mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Begin support for looping-back recursive pointers to their source layouts
This commit is contained in:
parent
a30a4e36ed
commit
8750127111
17 changed files with 57 additions and 47 deletions
|
@ -45,7 +45,7 @@ pub fn eq_generic<'a>(
|
|||
eq_boxed(root, ident_ids, ctx, layout_interner, inner_layout)
|
||||
}
|
||||
Layout::LambdaSet(_) => unreachable!("`==` is not defined on functions"),
|
||||
Layout::RecursivePointer => {
|
||||
Layout::RecursivePointer(_) => {
|
||||
unreachable!(
|
||||
"Can't perform `==` on RecursivePointer. Should have been replaced by a tag union."
|
||||
)
|
||||
|
@ -451,7 +451,7 @@ fn eq_tag_fields<'a>(
|
|||
// (If there are more than one, the others will use non-tail recursion)
|
||||
let rec_ptr_index = field_layouts
|
||||
.iter()
|
||||
.position(|field| matches!(layout_interner.get(*field), Layout::RecursivePointer));
|
||||
.position(|field| matches!(layout_interner.get(*field), Layout::RecursivePointer(_)));
|
||||
|
||||
let (tailrec_index, innermost_stmt) = match rec_ptr_index {
|
||||
None => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue