summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/discard-returns.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/diagnostics/discard-returns.lua b/test/diagnostics/discard-returns.lua
index 5acd6146..16ac8245 100644
--- a/test/diagnostics/discard-returns.lua
+++ b/test/diagnostics/discard-returns.lua
@@ -261,3 +261,13 @@ local t = {10, 20, 30}
for element in list_iter(t) do
end
]]
+
+TEST [[
+---@nodiscard
+local function f()
+ return 1
+end
+
+if f() then
+end
+]]