Skip to content

feat: support enum-to-enum mapping with different properties#15

Merged
wilmveel merged 1 commit intomainfrom
fix/enum-label-property-mapping
Mar 25, 2026
Merged

feat: support enum-to-enum mapping with different properties#15
wilmveel merged 1 commit intomainfrom
fix/enum-label-property-mapping

Conversation

@wilmveel
Copy link
Copy Markdown
Contributor

Summary

  • Skip field resolution in the FIR checker when both source and target are enums with matching entry names, preventing false "Missing mapping for: label" errors
  • Handle direct enum-to-enum mapping in the IR visitor (previously only worked for enum fields nested inside data classes)
  • Add 4 new test cases covering enum mapping with extra properties (both as nested fields and direct mapping, in both directions)

Closes #14

Test plan

  • shouldCompile_enumWithLabelProperty — maps data class with plain enum field to data class with labeled enum field
  • shouldCompile_enumWithLabelPropertyReverse — reverse direction
  • shouldCompile_directEnumWithLabelProperty — direct plain enum → labeled enum mapping
  • shouldCompile_directEnumWithLabelPropertyReverse — direct labeled enum → plain enum mapping
  • All existing tests pass (no regressions)

🤖 Generated with Claude Code

Skip field resolution for enum types in the FIR checker when both source
and target are enums with matching entry names. Also handle direct
enum-to-enum mapping in the IR visitor (not just nested enum fields).

Closes #14

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wilmveel wilmveel force-pushed the fix/enum-label-property-mapping branch from 278abed to 15c49a3 Compare March 25, 2026 18:24
@wilmveel wilmveel merged commit 89cf98d into main Mar 25, 2026
1 check passed
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.

Support enum-to-enum mapping when enums have different properties

1 participant