diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-12 16:16:58 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-12 16:17:17 +0800 |
commit | 7340483dc3071c33d5d2a726032a61632c28509a (patch) | |
tree | a0aa7d35eace42c3b68cefc115b9915b6a414739 /test | |
parent | 9902665e2a4fa9b69726df2ccce997312750c2a7 (diff) | |
download | lua-language-server-7340483dc3071c33d5d2a726032a61632c28509a.zip |
unreachable-code
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/common.lua | 28 | ||||
-rw-r--r-- | test/type_inference/init.lua | 1 |
2 files changed, 29 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 +]] diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 91182af8..30f47900 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3714,3 +3714,4 @@ A.B.C = 1 print(A.B.<?C?>) ]] + |