diff options
Diffstat (limited to 'test/diagnostics')
-rw-r--r-- | test/diagnostics/type-check.lua | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index 5450eda4..a938f14c 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -810,16 +810,29 @@ local function f(x) end ]] ---TEST [[ ------@param x boolean ------@return number ------@overload fun() ---local function f(x) --- if x then --- return 1 --- end ---end ---]] +TEST [[ +---@param x boolean +---@return number +---@overload fun() +local function f(x) + if x then + return 1 + end +end +]] + +TEST [[ +---@param x boolean +---@return number +---@overload fun(): boolean, boolean +local function f(x) + if x then + return 1 + else + return false, false + end +end +]] config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'unused-function') |