mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 12:16:43 +00:00
[ty] Fix panic due to simplifying Divergent types out of intersections types (#21253)
This commit is contained in:
parent
39f105bc4a
commit
b5305b5f32
3 changed files with 60 additions and 23 deletions
|
|
@ -0,0 +1,10 @@
|
|||
# Regression test for https://github.com/astral-sh/ruff/pull/20962
|
||||
# error message:
|
||||
# `infer_definition_types(Id(1804)): execute: too many cycle iterations`
|
||||
|
||||
for name_1 in {
|
||||
{{0: name_4 for unique_name_0 in unique_name_1}: 0 for unique_name_2 in unique_name_3 if name_4}: 0
|
||||
for unique_name_4 in name_1
|
||||
for name_4 in name_1
|
||||
}:
|
||||
pass
|
||||
|
|
@ -35,16 +35,3 @@ else:
|
|||
async def name_5():
|
||||
pass
|
||||
```
|
||||
|
||||
## Too many cycle iterations in `infer_definition_types`
|
||||
|
||||
<!-- expect-panic: too many cycle iterations -->
|
||||
|
||||
```py
|
||||
for name_1 in {
|
||||
{{0: name_4 for unique_name_0 in unique_name_1}: 0 for unique_name_2 in unique_name_3 if name_4}: 0
|
||||
for unique_name_4 in name_1
|
||||
for name_4 in name_1
|
||||
}:
|
||||
pass
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue