Skip to content

Commit 6803eb5

Browse files
committed
Add ~= nil check
1 parent ac4d8bc commit 6803eb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/love-api.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ local function buildFunction(func, node, typeName)
156156
for _, param in ipairs(func.variants[1].arguments or {}) do
157157
for paramName in param.name:gmatch '[%a_][%w_]*' do
158158
params[#params+1] = paramName
159-
local optional = param.type == 'table' and isTableOptional(param.table) or param.default
159+
local optional = param.type == 'table' and isTableOptional(param.table) or (param.default ~= nil)
160160
text[#text+1] = ('---@param %s%s %s # %s'):format(
161161
paramName,
162162
optional and '?' or '',

0 commit comments

Comments
 (0)