Skip to content

Commit 836df0e

Browse files
committed
注解让V4满意
1 parent ab48751 commit 836df0e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎script/core/completion/completion.lua‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ local function insertEnum(state, pos, src, enums, isInArray, mark)
13621362
insertDocEnum(state, pos, src, enums)
13631363
end
13641364
elseif isInArray and src.type == 'doc.type.array' then
1365-
for _, d in ipairs(vm.getDefs(src.node)) do
1365+
for _, d in ipairs(vm.getDefs(src.node or {})) do
13661366
insertEnum(state, pos, d, enums, isInArray, mark)
13671367
end
13681368
elseif src.type == 'global' and src.cate == 'type' then
@@ -1858,7 +1858,7 @@ local function tryluaDocBySource(state, position, source, results)
18581858
if name
18591859
and name ~= source.parent.class[1]
18601860
and not used[name]
1861-
and matchKey(source[1], name) then
1861+
and matchKey(source[1], name--[[@as string]]) then
18621862
used[name] = true
18631863
results[#results+1] = {
18641864
label = name,
@@ -1881,7 +1881,7 @@ local function tryluaDocBySource(state, position, source, results)
18811881
or (doc.type == 'doc.enum' and doc.enum[1])
18821882
if name
18831883
and not used[name]
1884-
and matchKey(source[1], name) then
1884+
and matchKey(source[1], name--[[@as string]]) then
18851885
used[name] = true
18861886
results[#results+1] = {
18871887
label = name,

‎script/vm/function.lua‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function vm.countReturnsOfCall(func, args, mark)
288288
return min or 0, max or math.huge, def or 0
289289
end
290290

291-
---@param list parser.object[]?
291+
---@param list parser.object | parser.object[] | nil
292292
---@param mark? table
293293
---@return integer min
294294
---@return number max
@@ -297,7 +297,7 @@ function vm.countList(list, mark)
297297
if not list then
298298
return 0, 0, 0
299299
end
300-
local lastArg = list[#list]
300+
local lastArg = list[#list]--[[@as parser.object?]]
301301
if not lastArg then
302302
return 0, 0, 0
303303
end

0 commit comments

Comments
 (0)