Skip to content

Emit named C array typedefs and nested generic enums - #21

Merged
Cod-e-Codes merged 1 commit into
mainfrom
codegen-array-typedefs-enum-payloads
Aug 14, 2026
Merged

Emit named C array typedefs and nested generic enums#21
Cod-e-Codes merged 1 commit into
mainfrom
codegen-array-typedefs-enum-payloads

Conversation

@Cod-e-Codes

Copy link
Copy Markdown
Owner

Summary

  • Named C array typedefs (arr_int_2) so nested arrays, Box<[T; N]>, and Vec<[T; N]> emit valid C. Array return ABI stays pointer decay.
  • Collect generic instantiations from enum payloads and close generic templates; emit Option_int before embedding types such as Hold. Forward-declare user structs/enums so Option_ref_Op is valid C.
  • Tests, ION_SPEC/ABI/skills, changelog, and crate bump to 0.1.22.

Test plan

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test
  • tests/test_runner.sh (345 passed)
  • ion-build every examples/*/ion.toml; data_lib output matches README

Nested arrays and Box/Vec of arrays need identifier type names, and enum payloads such as Hold::H(Option::None) must collect and emit Option_int before the embedding type.
@Cod-e-Codes
Cod-e-Codes merged commit 5c451cf into main Aug 14, 2026
7 checks passed
@Cod-e-Codes
Cod-e-Codes deleted the codegen-array-typedefs-enum-payloads branch August 14, 2026 16:42
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.

1 participant