mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Add test for outer scope transient captures
This commit is contained in:
parent
5ead673cfc
commit
4b55416ca1
1 changed files with 22 additions and 0 deletions
|
@ -3971,3 +3971,25 @@ fn deep_transient_capture_chain_with_multiple_captures() {
|
||||||
RocStr
|
RocStr
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||||
|
fn transient_captures_from_outer_scope() {
|
||||||
|
assert_evals_to!(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
x = "abc"
|
||||||
|
|
||||||
|
getX = \{} -> x
|
||||||
|
|
||||||
|
innerScope =
|
||||||
|
h = \{} -> getX {}
|
||||||
|
h {}
|
||||||
|
|
||||||
|
innerScope
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
RocStr::from("abc"),
|
||||||
|
RocStr
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue