From 3bfa31ba7d72686b21b12ab0f6ab98aeb5aee5b4 Mon Sep 17 00:00:00 2001 From: Pierre Chapuis Date: Fri, 3 Jan 2025 15:36:55 +0100 Subject: [PATCH] tests: add a non-regression test for return arity edge case (#892) Fixes #741 (fixed in Teal 0.24.0) --- spec/lang/statement/return_spec.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/lang/statement/return_spec.lua b/spec/lang/statement/return_spec.lua index 1b9f17949..73a28c762 100644 --- a/spec/lang/statement/return_spec.lua +++ b/spec/lang/statement/return_spec.lua @@ -37,6 +37,14 @@ describe("return", function() return bar() end ]], {})) + + it("with zero (regression test for #741)", util.check([[ + local function bar() end + + local function foo() + return bar() + end + ]])) end) describe("type checking", function()