diff options
Diffstat (limited to 'test/hover')
-rw-r--r-- | test/hover/init.lua | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/test/hover/init.lua b/test/hover/init.lua index 47204e3a..165f62c5 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -2280,3 +2280,103 @@ local t: B { z: number, } ]] + +TEST [[ +---@class A +local mt = {} + +---@private +function mt:init() +end + +---@protected +function mt:update() +end + +function mt:get() +end + +print(<?mt?>) +]] +[[ +local mt: A { + get: function, + init: function, + update: function, +} +]] + +TEST [[ +---@class A +local mt = {} + +---@private +function mt:init() +end + +---@protected +function mt:update() +end + +function mt:get() +end + +---@type A +local <?obj?> +]] +[[ +local obj: A { + get: function, +} +]] + +TEST [[ +---@class A +local mt = {} + +---@private +function mt:init() +end + +---@protected +function mt:update() +end + +function mt:get() +end + +---@class B: A +local <?obj?> +]] +[[ +local obj: B { + get: function, + update: function, +} +]] + +TEST [[ +---@class A +local mt = {} + +---@private +function mt:init() +end + +---@protected +function mt:update() +end + +function mt:get() +end + +---@class B: A + +---@type B +local <?obj?> +]] +[[ +local obj: B { + get: function, +} +]] |