What are the steps to reproduce this issue?(重现步骤?)
---@generic T
---@param _objects T[]
---@param _onCreate fun(obj:T)
function Builder:new(_objects, _onCreate)
local myObject = {}
---@param _onPress fun(obj: tipOrTrick)
function myObject:setOnPress(_onPress)
end
return myObject
end
What happens?(出现什么问题?)
The Builder:new() function knows the type of T, myObject:setOnPress() doesn't
What were you expecting to happen?(期望?)
Both to be aware of the type of T
Any other comments?(其它说明)
I started the implementation of this, the @param annotation already is aware of the 'T' by looking recursively to parent. But I can't figure out how to correctly infer it yet. Perhaps someone with more experience in the plugin can help me finish it? You can see the current implementation here: https://github.com/pouwelsjochem/IntelliJ-EmmyLua/tree/recursive_generic_type
Environment(环境)
What are the steps to reproduce this issue?(重现步骤?)
What happens?(出现什么问题?)
The
Builder:new()
function knows the type of T,myObject:setOnPress()
doesn'tWhat were you expecting to happen?(期望?)
Both to be aware of the type of T
Any other comments?(其它说明)
I started the implementation of this, the @param annotation already is aware of the 'T' by looking recursively to parent. But I can't figure out how to correctly infer it yet. Perhaps someone with more experience in the plugin can help me finish it? You can see the current implementation here: https://github.com/pouwelsjochem/IntelliJ-EmmyLua/tree/recursive_generic_type