Merge pull request #4950 from roc-lang/keep-recptr-index

Initial support for linking recursive pointer layouts back to their source layouts
This commit is contained in:
Ayaz 2023-01-24 14:42:00 -06:00 committed by GitHub
commit ad84e02abf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 639 additions and 132 deletions

View file

@ -7670,7 +7670,7 @@ fn store_tag_pattern<'a>(
for (index, (argument, arg_layout)) in arguments.iter().enumerate().rev() {
let mut arg_layout = *arg_layout;
if let Layout::RecursivePointer = layout_cache.get_in(arg_layout) {
if let Layout::RecursivePointer(_) = layout_cache.get_in(arg_layout) {
// TODO(recursive-layouts): fix after disjoint rec ptrs
arg_layout = layout_cache.put_in(Layout::Union(union_layout));
}
@ -7748,7 +7748,7 @@ fn store_newtype_pattern<'a>(
for (index, (argument, arg_layout)) in arguments.iter().enumerate().rev() {
let mut arg_layout = *arg_layout;
if let Layout::RecursivePointer = layout_cache.get_in(arg_layout) {
if let Layout::RecursivePointer(_) = layout_cache.get_in(arg_layout) {
arg_layout = layout;
}