You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detecting the type of an expression (e.g. operator mul()) fails, if the second operand is a union type.
Interestingly, the type is identified correctly if the first operand is a union type.
Here is an example. Lines are marked 'wrong' if detection of the correct type fails.
This can quickly become disturbing if you get a warning for each function saying that it returns a "wrong" type:
---@paramfooFoo|Bar---@parambarBar---@returnFoolocalfunctionfunc4(foo, bar)
localret=bar*fooreturnret-- incorrectly warning about wrong typeend
I understand that it can get quite difficult to determine the correct type. Would it be reasonable to give an expression a special "undefined type" if calculation of the correct type is too cumbersome? And then add a user switch stating whether or not a warning should be issued if an expression has "undefined type"?
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered:
How are you using the lua-language-server?
Other
Which OS are you using?
Linux
What is the issue affecting?
Type Checking
Expected Behaviour
See "Reproduction steps".
Actual Behaviour
See "Reproduction steps".
Reproduction steps
Detecting the type of an expression (e.g. operator mul()) fails, if the second operand is a union type.
Interestingly, the type is identified correctly if the first operand is a union type.
Here is an example. Lines are marked 'wrong' if detection of the correct type fails.
This can quickly become disturbing if you get a warning for each function saying that it returns a "wrong" type:
I understand that it can get quite difficult to determine the correct type. Would it be reasonable to give an expression a special "undefined type" if calculation of the correct type is too cumbersome? And then add a user switch stating whether or not a warning should be issued if an expression has "undefined type"?
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: