You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---@class CfgVO
---@field id number
---@field p1 string
---@field p2 string
main.lua
---@type CfgVO
local cfg = {};
print(cfg.id, cfg.p1, cfg.p2)
for i=1, 10 do
---@type CfgVO
local cfg = {};
print(cfg.id, cfg.p1, cfg.p2)
end
local tmp = {}
for k,v in pairs(tmp) do
---@type CfgVO
local cfg = {};
print(cfg.id, cfg.p1, cfg.p2)
end
如下图,for循环中cfg识别正常,但是for pairs中识别错误
The text was updated successfully, but these errors were encountered:
版本 v3.2.3
CfgVO.lua
main.lua
如下图,for循环中cfg识别正常,但是for pairs中识别错误

The text was updated successfully, but these errors were encountered: