IntelliJ-Luanalysis
IntelliJ-Luanalysis copied to clipboard
Packing the results of a function doesn't detect multiple return values
What are the steps to reproduce this issue?
---@shape Color
---@field [1] number
---@field [2] number
---@field [3] number
local function returnColorRGB()
return 0, 0, 0
end
local colorByFunction = {returnColorRGB()} ---@type Color
local color = {0, 0, 0} ---@type Color
What happens?
The colorByFunction assignment gives an error saying:
Type mismatch. Missing member: '[2]' of: 'Color'
Type mismatch. Missing member: '[3]' of: 'Color'
What were you expecting to happen?
No errors to be given, since both color
and colorByFunction
assignments have the exact same resulting table.