Skip to content

Stack overflow with exactly recursive function #2800

@MeGaGiGaGon

Description

@MeGaGiGaGon

Summary

Sort of a followup/variation of #2039 that I found while messing around, since #2039 was fixed but this wasn't.

If a function takes exactly itself as a parameter, you get a stack overflow:
https://play.ty.dev/a29248ae-5b84-45f5-9bae-3b4027b31f54

from ty_extensions import TypeOf
def foo(x: TypeOf[foo]):
    ...

Though since as far as I can tell this requires TypeOf it may not be worth worrying about.

Also playground link from #2039 (comment) to show the playground is updated and to get your playground unstuck from the crash loop if you used the example link:
https://play.ty.dev/44b0b1bd-fa58-44f1-b68e-f3fdcba10c34

Version

ty 0.0.14 (16597f5 2026-01-26) playground e22fa4f14

Metadata

Metadata

Assignees

Labels

fatala fatal error (panic or crash)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions