diff options
Diffstat (limited to 'test/definition')
-rw-r--r-- | test/definition/luadoc.lua | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua index 4a23b2ac..1f3dae00 100644 --- a/test/definition/luadoc.lua +++ b/test/definition/luadoc.lua @@ -197,3 +197,59 @@ TEST [[ ---@type Cat local <?<!v!>?> ]] + +TEST [[ +---@class Foo +local Foo = {} +function Foo:<!bar1!>() end + +---@generic T +---@param arg1 T +---@return T +function Generic(arg1) print(arg1) end + +local v1 = Generic(Foo) +print(v1.<?bar1?>) +]] + +TEST [[ +---@class Foo +local Foo = {} +function Foo:bar1() end + +---@generic T +---@param arg1 T +---@return T +function Generic(arg1) print(arg1) end + +local v1 = Generic("Foo") +print(v1.<?bar1?>) +]] + +TEST [[ +---@class Foo +local Foo = {} +function Foo:bar1() end + +---@generic T +---@param arg1 `T` +---@return T +function Generic(arg1) print(arg1) end + +local v1 = Generic(Foo) +print(v1.<?bar1?>) +]] + +TEST [[ +---@class Foo +local Foo = {} +function Foo:<!bar1!>() end + +---@generic T +---@param arg1 `T` +---@return T +function Generic(arg1) print(arg1) end + +local v1 = Generic("Foo") +print(v1.<?bar1?>) +]] |