IntelliJ-EmmyLua
IntelliJ-EmmyLua copied to clipboard
Generic Type is forgotten inside of a LuaFuncBody
Environment(环境)
name | version |
---|---|
IDEA version | [e.g. IC2018.2 EAP, CL2018.1.2] |
EmmyLua version | [e.g. v1.2.5] |
OS | [e.g. OSX 10.13.4, Windows 10] |
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