SIGN IN SIGN UP

typedef: handle self-references in `_typebody!` (#61794)

When a struct is redefined, we first check whether the new definition is
in fact identical to the old definition, and if so we just reuse the old
type. Revise leans pretty heavily on this behavior, as signature
extraction relies (in corner cases) on struct definition. As identified
in #61789, the equivalence check failed for self-referential `struct`s

```julia
struct R
    x
    next::R
end
```

The fix is fairly straightforward: before comparing equivalence with
`equiv_field_types`, ensure that type-substitution occurs throughout the
struct definition.

Fixes #61789

This pull request was written with the assistance of generative AI
(Claude Code, Opus 4.7).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
T
Tim Holy committed
3d6bb833c5f0c3b983ff558696f81e4d7c81e7f2
Parent: c7a0052
Committed by GitHub <noreply@github.com> on 5/15/2026, 1:52:28 PM