mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Properly recast nested recursion pointers to their expanded layouts as needed
When we load a structure with a nested recursive pointer, the pointer may be loaded opaquely. We need to refine it to the concrete type wanted by the layout. This conversion can be removed after we upgrade to LLVM 15. Closes #5162
This commit is contained in:
parent
63ef4a486f
commit
3a960e7809
3 changed files with 59 additions and 25 deletions
|
@ -2235,3 +2235,29 @@ fn refcount_nullable_unwrapped_needing_no_refcount_issue_5027() {
|
|||
RocStr
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn issue_5162_recast_nested_nullable_unwrapped_layout() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r###"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
Concept : [
|
||||
AtomicConcept,
|
||||
ExistentialRestriction { role : Str, concept : Concept }
|
||||
]
|
||||
|
||||
bottom : Concept
|
||||
bottom = AtomicConcept
|
||||
|
||||
main =
|
||||
when Dict.single bottom 0 is
|
||||
_ -> Bool.true
|
||||
"###
|
||||
),
|
||||
true,
|
||||
bool
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue