lua-language-server
lua-language-server copied to clipboard
Nil check for functions
How are you using the lua-language-server?
NeoVim
Which OS are you using?
Linux
What is the issue affecting?
Type Checking, Diagnostics/Syntax Checking
Expected Behaviour
---@class Type1
---@field maybe_fun? fun(a: integer)
---@field absolutely_nil nil
---@type Type1
local type {
maybe_fun = nil
absolutely_nil = nil
}
type.maybe_fun(5) -- ERROR "maybe_fun" is nil, add nil check
type.absolutely_nil() -- ERROR "absolutely_nil" is nil
Actual Behaviour
---@class Type1
---@field maybe_fun? fun(a: integer)
---@field absolutely_nil nil
---@type Type1
local type {
maybe_fun = nil
absolutely_nil = nil
}
-- No error messages, luals does not complain at all
type.maybe_fun(5)
type.absolutely_nil()
Reproduction steps
- Run example
Additional Notes
No response
Log File
No response