Reveal Type and Hover Type inconsistency after type narrowing. #2024
Labels
bug
Something isn't working
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
Expected behaviour
reveal_type and hover type should always be same.
Actual behaviour
Somehow hovering over bottom x gives me a type of Unknown, but the reveal type is int.
Code Snippet / Additional information
I put this issue in pylance even though it's type checking related and maybe pyright is better because it's specifically hover type hint is off while reveal type hint is fine. This also seems weirdly specific to reveal_type as if I remove reveal_type here and make the code,
then hovering over bottom x shows expected type again.
Main reason I find hover being wrong in reveal type scenario an issue is original program this comes from was longer and x's hover type becomes incorrect after more logic outside of reveal type too. This is was first place I could track to where type started doing weird things.
The text was updated successfully, but these errors were encountered: