-
-
Notifications
You must be signed in to change notification settings - Fork 391
Closed
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Linux
What is the issue affecting?
Type Checking, Completion
Expected Behaviour
---
---Returns a random (index, value) pair from an array-like table.
---
---@generic V
---@param tbl {[any]: V}
---@return number, V
---@nodiscard
function extensions.table.randomipair(tbl) end
local _, a = extensions.table.randomipair({1, 'a', false})
print(a) --> integer|string|boolean
Actual Behaviour
---
---Returns a random (index, value) pair from an array-like table.
---
---@generic V
---@param tbl {[any]: V}
---@return number, V
---@nodiscard
function extensions.table.randomipair(tbl) end
local _, a = extensions.table.randomipair({1, 'a', false})
print(a) --> 1
Reproduction steps
Paste the above reproduction code and press ctrl + space on a.
Additional Notes
Tested on v3.8.1.
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels
