mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
fix index bug in recursive decrements
This commit is contained in:
parent
e0b5a76a04
commit
c848a85eb4
3 changed files with 54 additions and 6 deletions
|
@ -496,3 +496,33 @@ fn boxed_str_dec() {
|
|||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-wasm"))]
|
||||
fn non_nullable_unwrapped_alignment_8() {
|
||||
assert_refcounts!(
|
||||
indoc!(
|
||||
r#"
|
||||
Expr : [ZAdd Expr Expr, Val I64, Var I64]
|
||||
|
||||
eval : Expr -> I64
|
||||
eval = \e ->
|
||||
when e is
|
||||
Var _ -> 0
|
||||
Val v -> v
|
||||
ZAdd l r -> eval l + eval r
|
||||
|
||||
expr : Expr
|
||||
expr = (ZAdd (Val 4) (Val 5))
|
||||
|
||||
eval expr
|
||||
"#
|
||||
),
|
||||
i64,
|
||||
&[
|
||||
Deallocated, // Val 4
|
||||
Deallocated, // Val 5
|
||||
Deallocated, // ZAdd _ _
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue