Skip to content

Support arrays of compound types in codegen (#132)#192

Merged
aallan merged 1 commit into
mainfrom
feature/compound-arrays
Mar 4, 2026
Merged

Support arrays of compound types in codegen (#132)#192
aallan merged 1 commit into
mainfrom
feature/compound-arrays

Conversation

@aallan

@aallan aallan commented Mar 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extend array codegen to handle all element types: ADTs (i32 pointer, 4 bytes), Strings (ptr+len pair, 8 bytes), and nested arrays (ptr+len pair, 8 bytes)
  • Fix constructor pair-type field storage (e.g. Err("msg") with String field)
  • Add chained indexing for nested arrays (@Array<Array<Int>>.0[0][1])
  • 17 new tests (13 compound array + 4 updated helper tests), 1,370 tests total

Test plan

  • pytest tests/ -q — 1,370 passed
  • mypy vera/ — clean
  • python scripts/check_examples.py — all 15 examples pass
  • python scripts/check_version_sync.py — version 0.0.61 consistent

Closes #132

🤖 Generated with Claude Code

Extend array codegen to handle all element types, not just the five
primitives (Int, Nat, Float64, Bool, Byte).  ADT elements are stored
as i32 heap pointers (4 bytes), while String and nested-array elements
use (ptr, len) pairs (8 bytes).  Also fix constructor pair-type field
storage and add chained indexing for nested arrays.

Co-Authored-By: Claude <noreply@anthropic.invalid>
@aallan aallan merged commit 15bfd84 into main Mar 4, 2026
10 checks passed
@aallan aallan deleted the feature/compound-arrays branch March 4, 2026 10:44
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.

Arrays of compound types in codegen

1 participant