Closed AlexanderPodorov closed 3 hours ago
Yes, this behavior is expected given the fix to the other issue you filed. Refer to this post for an explanation.
If you use this pattern, you can either have accurate type inference or reasonable performance. You can't have both.
As a workaround, you could do this:
case A9() as x, B9() as y:
return f9(x, y)
Describe the bug Possible regression caused by https://github.com/microsoft/pyright/issues/9146. Type is not inferred for the long
match
statements.Code or Screenshots See the comments to the
test
function.VS Code extension or command-line Pylance
v2024.10.100
, Pyright1.1.384
.