mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-09 10:00:25 +00:00
![]() ## Summary This avoids a panic inside `TypeInferenceBuilder::infer_type_parameters` when encountering generic type aliases: ```py type ListOrSet[T] = list[T] | set[T] ``` To fix this properly, we would have to treat type aliases as being their own annotation scope [1]. The left hand side is a definition for the type parameter `T` which is being used in the special annotation scope on the right hand side. Similar to how it works for generic functions and classes. [1] https://docs.python.org/3/reference/compound_stmts.html#generic-type-aliases closes #14307 ## Test Plan Added new example to the corpus. |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |