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
Well, I have found another bug with union math in overloads, this time false negative:
fromtypingimportUnion, overload@overloaddeff(x: int, y: int) ->int: ...
@overloaddeff(x: object, y: str) ->str: ...
deff(x):
passx: Union[int, str]
y: Union[int, str]
f(x, y) # passes, but should fail because it never matches (str, int)
The problem is that make_simplified_union is used. On one hand this allows us to do unioning in more scenarios, on other hand it is dangerous for union counting in unioned args. I am not sure what to do. @Michael0x2a could you take care of this? (This is however not urgent, since this is a false negative.)
Sorry, for overtaking, but I went ahead and now have a possible fix for this in a form of a change to a union math logic, so I am un-assigning you here, but I hope you will review my PR that I will open soon :-)
Activity
Michael0x2a commentedon Jun 19, 2018
Will do -- I'll take a look a little later today.
ilevkivskyi commentedon Jun 20, 2018
Sorry, for overtaking, but I went ahead and now have a possible fix for this in a form of a change to a union math logic, so I am un-assigning you here, but I hope you will review my PR that I will open soon :-)
Michael0x2a commentedon Jun 20, 2018
No worries :)
I haven't actually started writing any code for this, so this works out perfectly.
Alternative algorithm for union math (#5255)