ty icon indicating copy to clipboard operation
ty copied to clipboard

Type Narrowing on match with multiple case

Open Polandia94 opened this issue 1 week ago • 1 comments

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

Polandia94 avatar Dec 17 '25 21:12 Polandia94

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.

carljm avatar Dec 17 '25 21:12 carljm