summaryrefslogtreecommitdiff
path: root/test/diagnostics/common.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-10-25 00:55:15 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-10-25 00:55:15 +0800
commite3edc5d1880a392e065a71926b6f8ff113ea300c (patch)
tree1b64dc28b4bdacd6ef44769fb38588c286a3adea /test/diagnostics/common.lua
parenta90a48c328045dd3f89da78a77f977ceb2cc7ae0 (diff)
downloadlua-language-server-e3edc5d1880a392e065a71926b6f8ff113ea300c.zip
diagnostic for invisible fields
#1316
Diffstat (limited to 'test/diagnostics/common.lua')
-rw-r--r--test/diagnostics/common.lua61
1 files changed, 61 insertions, 0 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua
index f7cbbb0d..0231cc86 100644
--- a/test/diagnostics/common.lua
+++ b/test/diagnostics/common.lua
@@ -2081,3 +2081,64 @@ end
print(1)
]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field public z number
+local t
+print(t.x)
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field public z number
+
+---@type A
+local t
+
+print(t.<!x!>)
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field public z number
+
+---@class B: A
+local t
+
+print(t.y)
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field public z number
+
+---@class B: A
+
+---@type B
+local t
+
+print(t.<!y!>)
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field public z number
+
+---@class B: A
+
+---@type B
+local t
+
+print(t.z)
+]]