summaryrefslogtreecommitdiff
path: root/test/diagnostics/duplicate-set-field.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/diagnostics/duplicate-set-field.lua')
-rw-r--r--test/diagnostics/duplicate-set-field.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/diagnostics/duplicate-set-field.lua b/test/diagnostics/duplicate-set-field.lua
index 52f70c9d..469bc3ea 100644
--- a/test/diagnostics/duplicate-set-field.lua
+++ b/test/diagnostics/duplicate-set-field.lua
@@ -41,3 +41,34 @@ m.x = nil
return m
]]
+
+TEST [[
+---@class A
+X = {}
+
+function <!X.f!>() end
+
+function <!X.f!>() end
+]]
+
+TEST [[
+---@meta
+
+---@class A
+X = {}
+
+function X.f() end
+
+function X.f() end
+]]
+
+TEST [[
+---@class A
+X = {}
+
+if true then
+ function X.f() end
+else
+ function X.f() end
+end
+]]