diff --git a/compiler/tests/function/mod.rs b/compiler/tests/function/mod.rs index 0c62b34e76..585d20c963 100644 --- a/compiler/tests/function/mod.rs +++ b/compiler/tests/function/mod.rs @@ -174,3 +174,11 @@ fn test_return_array_tuple_pass() { assert_satisfied(program); } + +#[test] +fn test_return_tuple_conditional() { + let bytes = include_bytes!("return_tuple_conditional.leo"); + let program = parse_program(bytes).unwrap(); + + assert_satisfied(program); +} diff --git a/compiler/tests/function/return_tuple_conditional.leo b/compiler/tests/function/return_tuple_conditional.leo new file mode 100644 index 0000000000..c63967f548 --- /dev/null +++ b/compiler/tests/function/return_tuple_conditional.leo @@ -0,0 +1,15 @@ +// Returns a tuple using a conditional "if" statement. +function tuple_conditional () -> ( + i64, + i64 +) { + if true { + return (1, 1) + } else { + return (2, 2) + } +} + +function main() { + let t = tuple_conditional(); +} \ No newline at end of file