Skip to content

Stack overflow on divergently recursive type statement with typevar with itself as the default #2889

@MeGaGiGaGon

Description

@MeGaGiGaGon

Summary

Found this while just messing around. This code:

type A[T = A] = A[int]

Gives a stack overflow like this thread '<unknown>' (27632) has overflowed its stack when run through ty (and crashes the playground).

Version

ty 0.0.18 (7516727 2026-02-20) playground dec65ad3c

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions