EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.73k stars 290 forks source link

Missing type of params in overrided function in derived class #480

Open Harrith opened 2 years ago

Harrith commented 2 years ago

IDE does not correctly set function param types in derived classes if I am overriding function from base class. Here is an example:

---@class Base
local Base = {}

---@param var integer
function Base:DummyFunction(var) end

---@class Derived : Base
local Derived = {}

function Derived:DummyFunction(var) dummy(var) end

So I specified in Base class that function "DummyFunction" has variable var of type integer. Then I want to override the function in Derived class. If I hover over the variable "var" IDE correctly tells me that the var is integer. However if I hover over the function name in Derived class IDE tells me that var is any.

I'd rather post some screenshots: image Here you can see that the variable "var" in derived class is correctly an integer.

image But if I hover over the function name, the variable var is any.