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>