Pyright hangs when a generic type alias definition refers to itself via typevar bound
Open
bug
- Dominant language
- Python
- Stars
- 15.6k
- Forks
- 1.8k
- Avg merge
- 12h 13m
- Merged PRs (30d)
- 52
Description
**Code or Screenshots**
```python
type Foo[T: Foo] = T
def func[T](x: Foo[T]) -> T: ...
```
Contributor guide
Research direction
Start by running the provided Python snippet in Pyright and confirming that analysis hangs on the self-referential generic type alias. Trace the type-alias and type-variable-bound handling to identify the loop, then add a regression test showing that this input completes without hanging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100