[ty] fix binary expression inference between boolean literals and bool instances by alpaylan · Pull Request #18663 · astral-sh/ruff (original) (raw)

@alpaylan

…e issue that coerces the inferred type to 'int' when the right side is a nominal instance such as a function call

@MichaReiser MichaReiser changed the titlefix 'BitwiseAnd' bug at https://github.com/astral-sh/ty/issues/649 [ty] fix 'BitwiseAnd' bug

Jun 13, 2025

carljm

carljm previously requested changes Jun 13, 2025

@alpaylan

… change the inference logic to be more general

AlexWaygood

AlexWaygood

@alpaylan

…ol' in order to trigger regression properly, change the integer casting logic to cast when the operator is not 'BitOr | BitAnd | BitXor' or when the other operand is an 'IntLiteral'

AlexWaygood

@AlexWaygood AlexWaygood changed the title[ty] fix 'BitwiseAnd' bug [ty] fix binary expression inference between boolean literals and bool instances

Jun 17, 2025

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})