-
-
Notifications
You must be signed in to change notification settings - Fork 358
overloading function makes returns inaccurate #1146
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I believe with your second version would actually function differently. In this case you are redefining the |
For the second one, I don't think it is actually overriding the definitions no. It seems that it actually properly overload the function definitions. Here this example: The only case it seems to override them is if they were a local function (or more accurately, the function was not defined in a table). In which case it makes sense to override that definition to the last defined function: |
The issue looks like it is the same as #871. |
Just remembered this issue exists. Testing again on 3.6.11 and the same behavior as described initially, have not changed. Doesn't seem related to #871. |
Only select overload by number of parameters for now. |
When setting an overload for some function with different returns, the suggested returns are always the sum of all possible returns no matter the used overload used.
For example:

Creating a function overload by defining it more than once seems to override the returns always although:
Not entirely sure if this is indeed the expected behavior, but it definitely seems like the language server has enough context to figure out the return type easily enough, I would suppose.
The text was updated successfully, but these errors were encountered: