summaryrefslogtreecommitdiff
path: root/test/diagnostics/missing-return-value.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/diagnostics/missing-return-value.lua')
-rw-r--r--test/diagnostics/missing-return-value.lua34
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
+]]