diff options
Diffstat (limited to 'test/diagnostics/common.lua')
-rw-r--r-- | test/diagnostics/common.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index e88fbf43..5e65b410 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -1704,3 +1704,41 @@ function t:init() end TEST [[ return function f(x, y, z) end ]] + +util.arrayInsert(disables, 'redundant-return') +TEST [[ +---@return number +function F() + <!return!> +end +]] + +TEST [[ +---@return number, number +function F() + <!return!> 1 +end +]] + +TEST [[ +---@return number, number? +function F() + return 1 +end +]] + +do return end +TEST [[ +---@return number +function F() + X = 1<!!> +end +]] + +TEST [[ +---@return number, number? +function F() + return 1, 1, <!1!> +end +]] +util.arrayRemove(disables, 'redundant-return') |