diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-10-12 21:11:18 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-10-12 21:11:18 +0800 |
commit | 7f04a46898cae87e57912a7e6b4739c61d74b18c (patch) | |
tree | 7fa0ff87c5407f2b0a835cc7a080e01e2760d1c1 /test | |
parent | b353856c94faa6ec76944f5dea70af3d31a77d14 (diff) | |
download | lua-language-server-7f04a46898cae87e57912a7e6b4739c61d74b18c.zip |
stash
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/type-check.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index 383527c2..5450eda4 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -784,6 +784,43 @@ local x t[x] = true ]] +TEST [[ +---@param x boolean +---@return number +---@overload fun(): boolean +local function f(x) + if x then + return 1 + else + return false + end +end +]] + +TEST [[ +---@param x boolean +---@return number +---@overload fun() +local function f(x) + if x then + return 1 + else + return + end +end +]] + +--TEST [[ +-----@param x boolean +-----@return number +-----@overload fun() +--local function f(x) +-- if x then +-- return 1 +-- end +--end +--]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'unused-function') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') |