ty
ty copied to clipboard
Type Narrowing on match with multiple case
Summary
Type Narrowing on a match class with multiple cases is not working correctly. If there is only one case is working fine. On pylance, and mypy the same example works
playground link https://play.ty.dev/30d20c1a-1fd3-4fdc-a495-675c0eb2dee8 on mypy https://mypy-play.net/?mypy=latest&python=3.12&gist=c5e206614ccee154996e4363afe72549
Version
No response
Thanks for the report!
This may be related to #690, but I'm not entirely sure whether it's that, or a limitation in our match handling, so I'll leave it open as a separate issue.