From 334b453c7c04016a454c5c7fe0715c42dfb6f254 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 26 Jul 2024 15:03:23 -0300 Subject: [PATCH] tests: add regression test to function call check crash Add another regression test to a bug fixed in f97625d3703ce71d67281c3cfc6b5ed7a1289fe8 Co-Authored-By: Victor Ilchev <46074073+V1K1NGbg@users.noreply.github.com> --- spec/call/function_spec.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/call/function_spec.lua b/spec/call/function_spec.lua index 3860c404..5788ff5b 100644 --- a/spec/call/function_spec.lua +++ b/spec/call/function_spec.lua @@ -104,5 +104,15 @@ describe("function calls", function() ]], { { y = 2, msg = "wrong number of arguments (given 0, expects at least 1 and at most 4)" }, })) + + it("with insufficient arguments (regression test)", util.check_type_error([[ + local function a(f: (function(): any), ...: any): (function():any) + return function(...): (function():any) + return f(a, ...) + end + end + ]], { + { y = 3, msg = "wrong number of arguments (given 2, expects 0)" }, + })) end) end)