You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pyright hangs in certain cases involving recursive type aliases.
Code or Screenshots
fromtypingimportTypeVar, GenericU=TypeVar("U")
T=TypeVar("T")
classA(Generic[T]):
passclassB(Generic[T]):
passclassTagged(Generic[T]):
passNoTag=A["Either[U]"] |B["Either[U]"]
Either=NoTag[U] |Tagged[NoTag[U]]
### If this is moved to a separate file, there is no problemProblem=Either[U]
Describe the bug
Pyright hangs in certain cases involving recursive type aliases.
Code or Screenshots
Here's my pyrightconfig.json:
Changing this to pythonVersion 3.12 and modifying the source accordingly fixes the problem:
With Python 3.11, using the
: TypeAlias
annotation does not fix the problem.VS Code extension or command-line
This issue also occurs in pyright 1.1.385.
The text was updated successfully, but these errors were encountered: