From f5bb7bbd8824a20c991587d5a774644aa98241d9 Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 3 Mar 2022 02:30:46 +0100 Subject: Allow returns without value --- src/interpret/operator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/interpret/operator.rs') diff --git a/src/interpret/operator.rs b/src/interpret/operator.rs index 057f942..9a68a7f 100644 --- a/src/interpret/operator.rs +++ b/src/interpret/operator.rs @@ -280,7 +280,7 @@ impl<'t> ValueOperator<'t> { Err(WalkerError { kind: WalkerErrorKind::Return(returned_value), .. - }) => Ok(returned_value), + }) => Ok(returned_value.unwrap_or_else(|| Value::void(self.types))), Err(x) => Err(CallError::InsideFunction(x)), } } -- cgit 1.4.1