Type inference from callable argument types depends on order of kwonly args #6492
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-1-normal
topic-type-variables
Running mypy 0.670 on the following example:
produces:
I was expecting
Revealed type is 'builtins.int*'
. If I swap the order of the keyword-only arguments tocallback
, so that the one I'm matching on is before the one that's getting defaulted, I get the expected behavior. If I modify the example so that there aren't any generic types in the signature ofinvoke
that need inference, i.e. replacingT
withint
, I get the expected behavior no matter what order thecallback
arguments are declared in.The text was updated successfully, but these errors were encountered: