summaryrefslogtreecommitdiff
path: root/server/test/definition/emmy.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/test/definition/emmy.lua')
-rw-r--r--server/test/definition/emmy.lua63
1 files changed, 63 insertions, 0 deletions
diff --git a/server/test/definition/emmy.lua b/server/test/definition/emmy.lua
new file mode 100644
index 00000000..82bac7a8
--- /dev/null
+++ b/server/test/definition/emmy.lua
@@ -0,0 +1,63 @@
+TEST [[
+---@class <!A!>
+---@class B : <?A?>
+]]
+
+TEST [[
+---@class <!A!>
+---@type B|<?A?>
+]]
+
+TEST [[
+---@class A
+local mt = {}
+function mt:<!cast!>()
+end
+
+---@type A
+local obj
+obj:<?cast?>()
+]]
+
+TEST [[
+---@class A
+local <!mt!> = {}
+function mt:cast()
+end
+
+---@type A
+local <!obj!>
+<?obj?>:cast()
+]]
+
+TEST [[
+---@type A
+local <?obj?>
+
+---@class A
+local <!mt!>
+]]
+
+TEST [[
+---@type A
+local obj
+obj:<?func?>()
+
+---@class A
+local mt
+function mt:<!func!>()
+end
+]]
+
+TEST [[
+---@type A
+local obj
+obj:<?func?>()
+
+local mt = {}
+mt.__index = mt
+function mt:<!func!>()
+end
+---@class A
+local obj = setmetatable({}, mt)
+]]