From 5083f1cd9438da23f1022327ea24e7044bcc2f49 Mon Sep 17 00:00:00 2001 From: Paul Emmerich Date: Sun, 1 Sep 2024 12:32:33 +0200 Subject: Fix setfenv definition The first parameter got parsed as `async fun(...):(...|integer)` which triggered an incorrect warning when using it as `setfenv(2, env)` --- changelog.md | 1 + meta/template/basic.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index dd5dd5c4..18c85610 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ * `NEW` Custom documentation exporter * `NEW` Setting: `Lua.docScriptPath`: Path to a script that overrides `cli.doc.export`, allowing user-specified documentation exporting. +* `FIX` Lua 5.1: fix incorrect warning when using setfenv with an int as first parameter ## 3.10.5 `2024-8-19` diff --git a/meta/template/basic.lua b/meta/template/basic.lua index 75cd1dee..70303ca0 100644 --- a/meta/template/basic.lua +++ b/meta/template/basic.lua @@ -210,7 +210,7 @@ function select(index, ...) end ---@version 5.1 ---#DES 'setfenv' ----@param f async fun(...):...|integer +---@param f (async fun(...):...)|integer ---@param table table ---@return function function setfenv(f, table) end -- cgit v1.2.3