summaryrefslogtreecommitdiff
path: root/test/diagnostics/init.lua
diff options
context:
space:
mode:
authorLei Zhu <uhziel@gmail.com>2020-12-23 15:29:05 +0800
committerLei Zhu <uhziel@gmail.com>2020-12-23 15:29:05 +0800
commit2ab172bbd6e0f2eeed3388bd69947d3840e5ff15 (patch)
tree296e6692c7f158fb746c9aca4166d4147a798241 /test/diagnostics/init.lua
parentcb28b668db32b7afe29c9d01dfcc700b0377e266 (diff)
downloadlua-language-server-2ab172bbd6e0f2eeed3388bd69947d3840e5ff15.zip
undefined-field不要检测类型为table的,会出现很多误报
如果确需要它的形状是table,请使用类型 table*
Diffstat (limited to 'test/diagnostics/init.lua')
-rw-r--r--test/diagnostics/init.lua9
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!>)
+]]