From d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6 Mon Sep 17 00:00:00 2001 From: Roberto I Date: Thu, 30 Oct 2025 11:07:01 -0300 Subject: Vertical bar removed from syntax of vararg table The syntax 'function foo (a, b, ...arg)' is already used by JavaScript for this same semantics, so it seems natural to use the same notation in Lua. --- testes/locals.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testes/locals.lua') diff --git a/testes/locals.lua b/testes/locals.lua index 5222802f..6cd10547 100644 --- a/testes/locals.lua +++ b/testes/locals.lua @@ -310,7 +310,7 @@ do -- testing presence of second argument local function foo (howtoclose, obj, n) local ca -- copy of 'a' visible inside its close metamethod do - local a = func2close(function (... | t) + local a = func2close(function (...t) assert(select("#", ...) == n) assert(t.n == n and t[1] == ca and (t.n < 2 or t[2] == obj)) ca = 15 -- final value to be returned if howtoclose=="scope" @@ -910,7 +910,7 @@ do local extrares -- result from extra yield (if any) - local function check (body, extra, ...|t) + local function check (body, extra, ...t) local co = coroutine.wrap(body) if extra then extrares = co() -- runs until first (extra) yield -- cgit v1.2.3-55-g6feb