diff options
author | Lei Zhu <uhziel@gmail.com> | 2020-12-23 15:29:05 +0800 |
---|---|---|
committer | Lei Zhu <uhziel@gmail.com> | 2020-12-23 15:29:05 +0800 |
commit | 2ab172bbd6e0f2eeed3388bd69947d3840e5ff15 (patch) | |
tree | 296e6692c7f158fb746c9aca4166d4147a798241 /test/diagnostics/init.lua | |
parent | cb28b668db32b7afe29c9d01dfcc700b0377e266 (diff) | |
download | lua-language-server-2ab172bbd6e0f2eeed3388bd69947d3840e5ff15.zip |
undefined-field不要检测类型为table的,会出现很多误报
如果确需要它的形状是table,请使用类型 table*
Diffstat (limited to 'test/diagnostics/init.lua')
-rw-r--r-- | test/diagnostics/init.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index cfd0f4cb..c2c3ae4f 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -945,3 +945,12 @@ v2 = v v2:method1() v2:method2() -- 这个感觉实际应该报错更合适 ]] + +TEST [[ +---@type table +T1 = {} +print(T1.f1) +---@type table* +T2 = {} +print(T2.<!f2!>) +]] |