From 1e51dd0617a9ae55703700550b6db211080a8c13 Mon Sep 17 00:00:00 2001 From: fesily Date: Wed, 17 Jan 2024 15:00:54 +0800 Subject: doc param support generic pattern --- test/definition/luadoc.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/definition') diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua index b877f5cd..7a460593 100644 --- a/test/definition/luadoc.lua +++ b/test/definition/luadoc.lua @@ -304,6 +304,21 @@ local v1 = Generic(Foo) print(v1.) ]] + +TEST [[ +---@class n.Foo +local Foo = {} +function Foo:bar1() end + +---@generic T +---@param arg1 n.`T` +---@return T +function Generic(arg1) print(arg1) end + +local v1 = Generic(Foo) +print(v1.) +]] + TEST [[ ---@class Foo local Foo = {} @@ -318,6 +333,21 @@ local v1 = Generic("Foo") print(v1.) ]] + +TEST [[ +---@class n.Foo +local Foo = {} +function Foo:() end + +---@generic T +---@param arg1 n.`T` +---@return T +function Generic(arg1) print(arg1) end + +local v1 = Generic("Foo") +print(v1.) +]] + TEST [[ ---@class A local t -- cgit v1.2.3