diff options
Diffstat (limited to 'test/definition/emmy.lua')
-rw-r--r-- | test/definition/emmy.lua | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/test/definition/emmy.lua b/test/definition/emmy.lua new file mode 100644 index 00000000..ee8fa6a7 --- /dev/null +++ b/test/definition/emmy.lua @@ -0,0 +1,91 @@ +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) +]] + +TEST [[ +---@alias <!B A!> +---@type <?B?> +]] + +TEST [[ +---@class <!Class!> +---@param a <?Class?> +]] + +TEST [[ +---@class Class +---@field <!name string!> +---@field id integer +local mt = {} +mt.<?name?> +]] + +TEST [[ +---@class loli +local unit + +function unit:<!pants!>() +end + +---@see loli#<?pants?> +]] |