diff options
Diffstat (limited to 'test/diagnostics/missing-return-value.lua')
-rw-r--r-- | test/diagnostics/missing-return-value.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/diagnostics/missing-return-value.lua b/test/diagnostics/missing-return-value.lua new file mode 100644 index 00000000..3bad7974 --- /dev/null +++ b/test/diagnostics/missing-return-value.lua @@ -0,0 +1,34 @@ +TEST [[ +---@type fun():number +local function f() + <!return!> +end +]] + +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 +]] + +TEST [[ +---@return ... +function F() + return +end +]] |