GenerateEnums prefixes enum constant names when two enums share a value (e.g. "running" in both instance-state and volume-state becomes InstanceStateRunning / VolumeStateRunning). The conflict check calls e1.GetValues(), which returns already-prefixed names for enums marked in an earlier iteration. Those prefixed names no longer match the raw values of later enums, so some conflicts are missed and affected enums stay unprefixed.
Whether an enum gets prefixed ends up depending on iteration order rather than actual value overlap.
Minimal reproduction: three string enums where A shares "running" with B and "migrating" with C. A and B are compared first and both get marked. When A is later compared with C, A.GetValues() returns ["AStateRunning", "AStateMigrating"], neither of which matches C's raw value "Migrating", so C stays unprefixed.
Fix: compare Schema.EnumValues keys instead of GetValues() output. EnumValues always holds unprefixed identifiers regardless of whether the enum has been marked yet. PR: #2390
GenerateEnumsprefixes enum constant names when two enums share a value (e.g."running"in bothinstance-stateandvolume-statebecomesInstanceStateRunning/VolumeStateRunning). The conflict check callse1.GetValues(), which returns already-prefixed names for enums marked in an earlier iteration. Those prefixed names no longer match the raw values of later enums, so some conflicts are missed and affected enums stay unprefixed.Whether an enum gets prefixed ends up depending on iteration order rather than actual value overlap.
Minimal reproduction: three string enums where A shares
"running"with B and"migrating"with C. A and B are compared first and both get marked. When A is later compared with C,A.GetValues()returns["AStateRunning", "AStateMigrating"], neither of which matches C's raw value"Migrating", so C stays unprefixed.Fix: compare
Schema.EnumValueskeys instead ofGetValues()output.EnumValuesalways holds unprefixed identifiers regardless of whether the enum has been marked yet. PR: #2390