Skip to content

unexpected need-check-nil in elseif #1026

@phanen

Description

@phanen
local stat ---@type { size: integer }?
if math.random() > 0.5 then
elseif not stat then
elseif stat.size > 0 then
end
Diagnostics:
1. stat may be nil [need-check-nil]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions