-
Notifications
You must be signed in to change notification settings - Fork 276
Stack overflow on recursive TypeIs with Callable #3134
Copy link
Copy link
Closed
astral-sh/ruff
#24245Labels
bugSomething isn't workingSomething isn't workingfatala fatal error (panic or crash)a fatal error (panic or crash)type aliases
Milestone
Description
Summary
This code:
from typing import TypeIs
from collections.abc import Callable
type A = TypeIs[Callable[[], A]]Causes a stack overflow like this: thread '<unknown>' (22356) has overflowed its stack
Note that this only applies to TypeIs, TypeGaurd works fine: https://play.ty.dev/74289a8f-cbff-4219-85a8-f3b8af2e8c10
Version
ty 0.0.21 (c1ad9f2 2026-03-06)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfatala fatal error (panic or crash)a fatal error (panic or crash)type aliases