summaryrefslogtreecommitdiff
path: root/test/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-04-17 18:29:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-04-17 18:29:12 +0800
commit9f97b95a71e33d0f63b482fe7d2142dc4dda0716 (patch)
tree4c04398ce2dbeeda50a5af177773302b80b04f07 /test/diagnostics
parent968aca97f67897583f9c5cec02b5901eeef2c86b (diff)
downloadlua-language-server-9f97b95a71e33d0f63b482fe7d2142dc4dda0716.zip
修正 `discard-returns` 对条件的误报
Diffstat (limited to 'test/diagnostics')
-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
+]]