Issue Description
Hi!
I have a code that looks something like this:
---@param t? table
function api.f(t)
t = type(t) == "table" and t or {}
t.x = t.x or {} --warning is raised but t can never be nil here because it is set to {} if it was but diagnostics fail to see that
--etc.
end
Nil checks are not required here because t should never be nil, the preceding lines redefines it as an empty table if it was nil or invalid so the reference should always exist when trying to check if x exists within the table.
I have seen similar reports but I'm not sure if this exact case has been reported or not. I couldn't find a match or I failed to recognize it.
Additional Notes
No response
Issue Description
Hi!
I have a code that looks something like this:
Nil checks are not required here because
tshould never be nil, the preceding lines redefines it as an empty table if it was nil or invalid so the reference should always exist when trying to check ifxexists within the table.I have seen similar reports but I'm not sure if this exact case has been reported or not. I couldn't find a match or I failed to recognize it.
Additional Notes
No response