Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Sep 28, 2021
1 parent 05555be commit f1a974b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
16 changes: 16 additions & 0 deletions script/core/noder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,8 @@ compileNodeMap = util.switch()
end
end
if source.args then
local parent = source.parent
local parentID = guide.isSet(parent) and getID(parent)
for i, arg in ipairs(source.args) do
if arg[1] == 'self' then
goto CONTINUE
Expand All @@ -1192,12 +1194,26 @@ compileNodeMap = util.switch()
, PARAM_NAME
, arg[1]
))
if parentID then
pushForward(noders, getID(arg), sformat('%s%s%s'
, parentID
, PARAM_NAME
, arg[1]
))
end
else
pushForward(noders, getID(arg), sformat('%s%s%s'
, id
, PARAM_NAME
, '...'
))
if parentID then
pushForward(noders, getID(arg), sformat('%s%s%s'
, parentID
, PARAM_NAME
, '...'
))
end
end
::CONTINUE::
end
Expand Down
12 changes: 6 additions & 6 deletions test/type_inference/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -872,9 +872,9 @@ for _, a in ipairs(v) do
end
]]

--TEST 'number' [[
-----@param x number
--local f
--
--f = function (<?x?>) end
--]]
TEST 'number' [[
---@param x number
local f
f = function (<?x?>) end
]]

0 comments on commit f1a974b

Please sign in to comment.