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
Currently, multiple "overloaded" annotations for the same function seem to always be combined into one union, instead of selecting the overload based on the actual, known argument values. For example:
The different values for the event_name parameter could be used to deduce the callback type, and therefore the type of the evt parameter. For example when used like this, the type of evt should be known to be event_b:
register_callback("a", function(evt)
print(evt.prop_a) -- validprint(evt.prop_b) -- not valid (Undefined field)end)
There are a bunch of issues referencing this. I think the title of this issue best suits the issue. However, the use case in this issue is almost the exact same as in #1456, which discusses changing the way things are overloaded.
Activity
carsakiller commentedon Feb 10, 2023
There are a bunch of issues referencing this. I think the title of this issue best suits the issue. However, the use case in this issue is almost the exact same as in #1456, which discusses changing the way things are overloaded.
Similar:
#1343
#1410
carsakiller commentedon Aug 21, 2024
This does indeed seem to be working now.