Shunsuke Shibayama
722f1a7d7a
[ty] fix stack overflow when comparing recursive NamedTuple types with is_disjoint_from ( #20538 )
...
## Summary
I found this bug while working on #20528 .
The minimum reproducible code is:
```python
from __future__ import annotations
from typing import NamedTuple
from ty_extensions import is_disjoint_from, static_assert
class Path(NamedTuple):
prev: Path | None
key: str
static_assert(not is_disjoint_from(Path, Path))
```
A stack overflow occurs when a nominal instance type inherits from
`NamedTuple` and is defined recursively.
This PR fixes this bug.
## Test Plan
mdtest updated
2025-09-23 19:29:03 +02:00
..
2025-09-17 14:58:54 -04:00
2025-09-19 17:00:37 -04:00
2025-07-31 11:28:03 +01:00
2025-05-17 08:27:32 -04:00
2025-09-23 14:26:55 +00:00
2025-09-23 14:26:55 +00:00
2025-09-23 14:26:55 +00:00
2025-09-17 09:45:25 +02:00
2025-07-30 17:40:24 +02:00
2025-08-04 20:13:50 +02:00
2025-09-07 18:25:35 +01:00
2025-06-26 14:29:33 +02:00
2025-09-23 14:26:55 +00:00
2025-08-27 13:21:47 +01:00
2025-05-09 13:40:51 -04:00
2025-08-11 15:29:58 -04:00
2025-09-23 14:26:55 +00:00
2025-08-29 08:44:18 +00:00
2025-09-23 14:02:25 +02:00
2025-09-15 11:00:03 +02:00
2025-09-23 14:26:55 +00:00
2025-09-17 18:51:50 -04:00
2025-09-23 14:26:55 +00:00
2025-09-23 14:26:55 +00:00
2025-09-23 14:26:55 +00:00
2025-09-23 14:26:55 +00:00
2025-05-22 21:37:03 -04:00
2025-09-23 14:26:55 +00:00
2025-07-22 16:10:38 +02:00
2025-09-17 18:51:50 -04:00
2025-07-31 19:45:01 +01:00
2025-09-23 19:29:03 +02:00
2025-09-15 12:06:48 +01:00
2025-05-06 20:11:25 -04:00
2025-09-23 14:26:55 +00:00
2025-07-30 11:51:21 +02:00
2025-09-23 14:26:55 +00:00
2025-08-29 16:19:45 -07:00
2025-05-13 21:27:48 +00:00
2025-05-09 13:40:51 -04:00
2025-09-17 18:51:50 -04:00
2025-07-22 16:10:38 +02:00
2025-09-23 14:26:55 +00:00
2025-09-23 12:22:59 +02:00
2025-09-04 15:28:33 -07:00
2025-09-16 16:44:11 -07:00
2025-09-07 18:25:35 +01:00
2025-07-21 19:37:55 +02:00
2025-08-11 22:03:32 +01:00
2025-05-06 20:11:25 -04:00
2025-09-10 11:38:58 +01:00
2025-09-15 16:21:53 +02:00
2025-09-23 14:02:25 +02:00
2025-09-17 09:45:25 +02:00
2025-09-10 11:14:26 +00:00
2025-09-22 08:29:03 +01:00
2025-09-08 21:08:35 +00:00
2025-09-23 14:26:55 +00:00
2025-08-25 18:49:49 +00:00
2025-07-25 07:11:11 +00:00
2025-09-11 10:14:38 +02:00
2025-09-15 16:21:53 +02:00
2025-09-10 15:54:06 +02:00
2025-09-17 18:51:50 -04:00
2025-09-23 14:26:55 +00:00