diff options
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/init.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 0dab932e..6ab57a06 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -563,6 +563,36 @@ for _, <?v?> in ipairs(t) do end ]] +TEST 'boolean' [[ +---@generic T: table, K, V +---@param t T +---@return fun(table: table<K, V>, index: K):K, V +---@return T +---@return nil +local function pairs(t) end + +---@type boolean[] +local t + +for k, <?v?> in pairs(t) do +end +]] + +TEST 'integer' [[ +---@generic T: table, K, V +---@param t T +---@return fun(table: table<K, V>, index: K):K, V +---@return T +---@return nil +local function pairs(t) end + +---@type boolean[] +local t + +for <?k?>, v in pairs(t) do +end +]] + TEST 'E' [[ ---@class A ---@class B: A |