Skip to content

Cascade class and enum renames through wrappers and function signatures - #315

Merged
matt-edmondson merged 3 commits into
mainfrom
claude/project-thread-kk9on7-222
Oct 22, 2026
Merged

matt-edmondson merged 3 commits into
mainfrom
claude/project-thread-kk9on7-222

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

Before: renaming a class or enum repointed member types and array elements only. A reference inside an Optional, Handle, Result, Span or Vector, or in an interface function's return type or parameter types, kept the old name, so Validate() reported a dangling reference straight after a successful rename. Renaming the enum named by Schema.ErrorType left that dangling too.

After: every type reference in the schema follows a rename, at any nesting depth, including Array<Optional<…>> and function signatures, and renaming the error enum repoints ErrorType.

How: EnumerateMemberTypes now also yields each interface function's return type and parameter types, and ExpandType recurses through WrapperType.ElementType and Vector.ElementType as well as Array.ElementType. Both class and enum renames and RepointArrayKeys use that walk. SchemaRenameTests gains five cases covering wrappers, an array of optionals, function signatures, enum references and the error type. All five fail without the change.

Closes #222


Generated by Claude Code

TryRenameClass and TryRenameEnum walked member types and arrays only, so a
reference inside Optional, Handle, Result, Span or Vector, or in an
interface function's return or parameter types, was left naming the old
type. The walk now covers every type reference in the schema, and renaming
the error enum also repoints Schema.ErrorType.

Closes #222

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017diBTKdccitjf28kU2Syfq
Main also repoints the error type when its enum is renamed; both sides' tests are kept.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9FBXHS37WoAF87LDY2ZVV
The unknown-option check refused every option on validate, so
`validate --no-data` failed once both changes reached main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017diBTKdccitjf28kU2Syfq
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 614ffbb into main Oct 22, 2026
16 checks passed
@matt-edmondson
matt-edmondson deleted the claude/project-thread-kk9on7-222 branch October 22, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Renaming a class or enum leaves dangling references inside Optional/Handle/Result wrappers and interface function signatures

2 participants