Skip to content

Conversation

@walker84837
Copy link
Collaborator

@walker84837 walker84837 commented Jan 17, 2026

This PR adds full enum support to kitc, allowing Kit developers to define sum types with optional associated data for each variant.
The enums compile into efficient C tagged unions that support default field values and partial initialization via automatic default filling.

@walker84837 walker84837 added the enhancement New feature or request label Jan 17, 2026
This commit adds support for partially instantiating enum variants by
automatically filling in missing arguments using their default values.
This aligns enum construction with user expectations and improves
ergonomics when working with variants that define defaults.

Summary of changes:

- Add example and expected output for partial enum usage
- Inline default arguments when generating constructor calls
- Fix argument assignment logic in enum codegen
- Update type inference to backfill missing default args
@walker84837 walker84837 marked this pull request as ready for review January 20, 2026 02:54
@walker84837 walker84837 changed the title Implement enums Implement ADTs with tagged-union compilation to C Jan 20, 2026
@walker84837 walker84837 merged commit a83b2d0 into main Jan 20, 2026
3 checks passed
@walker84837 walker84837 deleted the enum branch January 20, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants