summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/inject-field.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/diagnostics/inject-field.lua b/test/diagnostics/inject-field.lua
index 2c802270..f4d847e9 100644
--- a/test/diagnostics/inject-field.lua
+++ b/test/diagnostics/inject-field.lua
@@ -39,3 +39,26 @@ local m
m.xx = 1 -- OK
m.yy = 1 -- OK
]]
+
+TEST [[
+---@class Class
+---@field x number
+
+---@type Class
+local t
+
+t.x = 1 -- OK
+t.<!y!> = 2 -- Warning
+]]
+
+TEST [[
+---@class Class
+---@field x number
+---@field [any] any
+
+---@type Class
+local t
+
+t.x = 1 -- OK
+t.y = 2 -- OK
+]]