Skip to content

False positive need-check-nil when using or assignment for default value #937

@cyril0124

Description

@cyril0124
Image
---@param v fun()?
local function test(v)
    v = v or function()
    end

    v() -- Should not report `need-check-nil`
end

test()

It works correctly in version 0.19.0, but this error occurs in the latest version (0.20.0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions