diff --git a/changelog.md b/changelog.md index 4e08d43ca..dc854a4e8 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,7 @@ * `FIX` Fix type inference for bitwise operators (`<<`, `>>`, `&`, `|`, `~`) on integer variables * `FIX` Fix constant value computation for chained bitwise expressions in hover tooltips * `FIX` Support Lua 5.5 prefix local attributes such as `local x` and `local x` +* `FIX` Correct `os` and `io` meta return types. ## 3.17.1 `2026-01-20` diff --git a/meta/template/io.lua b/meta/template/io.lua index 2200a6268..76c54f989 100644 --- a/meta/template/io.lua +++ b/meta/template/io.lua @@ -26,7 +26,7 @@ io = {} ---#DES 'io.close' ---@param file? file* ----@return boolean? suc +---@return true? suc ---@return exitcode? exitcode ---@return integer? code function io.close(file) end @@ -119,7 +119,7 @@ local file = {} ---@alias exitcode "exit"|"signal" ---#DES 'file:close' ----@return boolean? suc +---@return true? suc ---@return exitcode? exitcode ---@return integer? code function file:close() end diff --git a/meta/template/os.lua b/meta/template/os.lua index 996a5c479..4452ee72e 100644 --- a/meta/template/os.lua +++ b/meta/template/os.lua @@ -50,7 +50,7 @@ function os.difftime(t2, t1) end function os.execute(command) end ---#else ---@param command? string ----@return boolean? suc +---@return true? suc ---@return exitcode? exitcode ---@return integer? code function os.execute(command) end @@ -75,15 +75,17 @@ function os.getenv(varname) end ---#DES 'os.remove' ---@param filename string ----@return boolean suc +---@return true? suc ---@return string? errmsg +---@return integer? errcode function os.remove(filename) end ---#DES 'os.rename' ---@param oldname string ---@param newname string ----@return boolean suc +---@return true? suc ---@return string? errmsg +---@return integer? errcode function os.rename(oldname, newname) end ---@alias localecategory