You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(🐞) false narrowing with reassignment in loop #11612
changed the title [-]false unreachable with conditional reassignment then continue in loop[/-][+](🐞) false unreachable with conditional reassignment then continue in loop[/+]on Oct 31, 2023
changed the title [-](🐞) false unreachable with conditional reassignment then continue in loop[/-][+](🐞) false unreachable with reassignment in loop[/+]on Oct 31, 2023
Activity
sobolevn commentedon Dec 6, 2021
This can be fixed by:
The other question is: why
ais not infered to beNone | int?KotlinIsland commentedon Dec 6, 2021
It is, if you put
reveal_typeafter the loop it reveals asint | NonePerhaps it is inferring as
int | None, but only past line 4, not considering the loop.[-]false unreachable with conditional reassignment then continue in loop[/-][+](🐞) false unreachable with conditional reassignment then continue in loop[/+][-](🐞) false unreachable with conditional reassignment then continue in loop[/-][+](🐞) false unreachable with reassignment in loop[/+]KotlinIsland commentedon Oct 31, 2023
@sobolevn It's not just the inference, I've updated the OP with a much better example.
[-](🐞) false unreachable with reassignment in loop[/-][+](🐞) false narrowing with reassignment in loop[/+]Avoid false `unreachable` and `redundant-expr` warnings in loops.
Avoid false `unreachable` and `redundant-expr` warnings in loops. (py…