mirror of
https://github.com/astral-sh/ruff
synced 2026-01-10 16:15:19 -05:00
## Summary closes https://github.com/astral-sh/ty/issues/692 If the expression (or any child expressions) is not definitely bound the reachability constraint evaluation is determined as ambiguous. This fixes the infinite cycles panic in the following code: ```py from typing import Literal class Toggle: def __init__(self: "Toggle"): if not self.x: self.x: Literal[True] = True ``` Credit of this solution is for David. ## Test Plan - Added a test case with too many cycle iterations panic. - Previous tests. --------- Co-authored-by: David Peter <mail@david-peter.de>