ty icon indicating copy to clipboard operation
ty copied to clipboard

Stack overflow with recursive callables

Open correctmost opened this issue 2 months ago • 1 comments

Summary

ty crashes when checking this code:

from typing import Callable

def fn[**T, U](c: Callable[T, U]) -> Callable[T, U]:
    return c

fn(fn)
thread '<unknown>' (2580764) has overflowed its stack
fatal runtime error: stack overflow, aborting

Version

a15bc9c249 w/ astral-sh/ruff@b36ff75a2

correctmost avatar Dec 17 '25 21:12 correctmost

Ha, nice. Thanks for the report!

carljm avatar Dec 17 '25 21:12 carljm