ruff
d9aaacd0 - [ty] Evaluate reachability of non-definitely-bound to Ambiguous (#19579)

Commit
37 days ago
[ty] Evaluate reachability of non-definitely-bound to Ambiguous (#19579) ## 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>
Author
Parents
Loading