diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-07 16:49:36 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-07 16:49:36 +0800 |
commit | 91f96833c301edbaa7225429c385ce487510a29f (patch) | |
tree | 56a6c03ca9c309d2026e346297c8cb66561fbe1e /test | |
parent | 3cdafcc068385ad25325dea8ddd33d1a8b380ba9 (diff) | |
download | lua-language-server-91f96833c301edbaa7225429c385ce487510a29f.zip |
fix #1292
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 2ae79a46..cc3b27e2 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3629,3 +3629,14 @@ local <?b?> TEST 'integer|false' [[ local <?b?> = X == 1 and X == 1 and 1 ]] + +TEST 'unknown|nil' [[ +local function f() + if X then + return ({})[1] + end + return nil +end + +local <?n?> = f() +]] |