You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Renaming an enum used as a map's keyType leaves the key type pointing at the old name, so the schema stops validating #337
#311 (for #300) added Array.KeyType, so a map can be keyed by a primitive or an enum. The rename cascade from #315 (for #222) finds a type's nested types through ExpandType, and that method only descends into ElementType:
As a result, TryRenameEnum updates every other reference to the enum except a map's keyType. The two PRs merged in the same batch, and neither covers the other.
Reproduction (verified)
Create an enum Slot with the value Head.
Create a class Inv with a member Items: Array { container: "map", elementType: String, keyType: Enum(Slot) }.
schema.Validate() reports no issues.
schema.TryRenameEnum(slot, "Slot2") returns true.
schema.Validate() now reports Enum type references unknown enum 'Slot'.
Generation is then refused until the file is fixed by hand. Renaming the enum in the editor tree goes through the same code path.
Fix / acceptance criteria
ExpandType, and anything else that enumerates nested types, yields Array.KeyType when it is set.
Add a test: renaming an enum used as a map keyType repoints the key type, and validation stays clean.
The C# generator's Dictionary<TKey, …> spelling uses the new enum name.
Priority: Medium. After the rename the schema stops validating, which is loud rather than silent, but it blocks editing until the key type is fixed by hand.
Activity
matt-edmondson commentedon Oct 25, 2026
Triage
keyType(Give a map its own key type #311)keyTypenot being handled everywhereKeyis.keyType). Not a duplicate.Generated by Claude Code