diff options
Diffstat (limited to 'test/diagnostics/common.lua')
-rw-r--r-- | test/diagnostics/common.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index fab02caf..1ab6ec5c 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -1958,3 +1958,31 @@ local <!ll!> ]] config.remove(nil, 'Lua.diagnostics.unusedLocalExclude', 'll_*') + +TEST [[ +---@diagnostic disable: undefined-global + +if X then + return false +elseif X then + return false +else + return false +end +<!return true!> +]] + +TEST [[ +---@diagnostic disable: undefined-global + +function X() + if X then + return false + elseif X then + return false + else + return false + end + <!return true!> +end +]] |