summaryrefslogtreecommitdiff
path: root/crates/typst-eval/src/call.rs
diff options
context:
space:
mode:
authorSébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com>2024-11-26 21:51:46 +0100
committerGitHub <noreply@github.com>2024-11-26 20:51:46 +0000
commit85d3a49a1a0bd50556b8b724a15aa29b074a2db7 (patch)
treebbce57ce9e782d28ea10e148027aa25198958384 /crates/typst-eval/src/call.rs
parent8fe8b2a23940f76077aa36eda305febd22e7cadc (diff)
Added warning when explicit return in code (not markup) discards joined content (#5413)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates/typst-eval/src/call.rs')
-rw-r--r--crates/typst-eval/src/call.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/typst-eval/src/call.rs b/crates/typst-eval/src/call.rs
index 9dfb7693..f48734cb 100644
--- a/crates/typst-eval/src/call.rs
+++ b/crates/typst-eval/src/call.rs
@@ -253,8 +253,8 @@ pub fn eval_closure(
// Handle control flow.
let output = body.eval(&mut vm)?;
match vm.flow {
- Some(FlowEvent::Return(_, Some(explicit))) => return Ok(explicit),
- Some(FlowEvent::Return(_, None)) => {}
+ Some(FlowEvent::Return(_, Some(explicit), _)) => return Ok(explicit),
+ Some(FlowEvent::Return(_, None, _)) => {}
Some(flow) => bail!(flow.forbidden()),
None => {}
}