diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-01 16:10:26 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-01 16:10:33 +0800 |
commit | 87e0a180f97cd6bc31909b60228f1148c0289529 (patch) | |
tree | da72f156113a156b960018ec352196823fe28649 /test | |
parent | cbcac3afc40268eae82a41a82248d912b1cfeeb6 (diff) | |
download | lua-language-server-87e0a180f97cd6bc31909b60228f1148c0289529.zip |
#1260 `type.weakNilCheck`
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/type-check.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index f4765370..32f60f82 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -609,5 +609,27 @@ local mt = G mt._x = nil ]] +config.set(nil, 'Lua.type.weakNilCheck', true) +TEST [[ +---@type number? +local nb + +---@type number +local n + +n = nb +]] + +TEST [[ +---@type number|nil +local nb + +---@type number +local n + +n = nb +]] +config.set(nil, 'Lua.type.weakNilCheck', false) + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') |