diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/init.lua | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index 5f69bdc9..e3bf9516 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -460,7 +460,7 @@ f(1, 2, 3) ]] TEST [[ -<!unpack!>(1) +<!unpack!>(<!1!>) ]] TEST [[ @@ -1133,3 +1133,68 @@ return { [<!2!>] = 4, } ]] + +TEST [[ +---@param table table +---@param metatable table +---@return table +function Setmetatable(table, metatable) end + +Setmetatable(<!1!>, {}) +]] + +TEST [[ +---@param table table +---@param metatable table +---@return table +function Setmetatable(table, metatable) end + +Setmetatable(<!'name'!>, {}) + +]] + +TEST [[ +---@param table table +---@param metatable table +---@return table +function Setmetatable(table, metatable) end + +---@type table +local name +---@type function +local mt +---err +Setmetatable(name, <!mt!>) +]] + +TEST [[ +---@param p1 string +---@param p2 number +---@return table +local function func1(p1, p2) end + +---@type string +local s +---@type table +local t +---err +func1(s, <!t!>) +]] + +TEST [[ +---@class bird +---@field wing string + +---@class eagle +---@field family bird + +---@class chicken +---@field family bird + +---@param bd eagle +local function fly(bd) end + +---@type chicken +local h +fly(<!h!>) +]] |