Skip to content

Fix array-backed generated slices - #23

Merged
RejectKid merged 1 commit into
masterfrom
fix-array-backed-slice
Jul 22, 2026
Merged

Fix array-backed generated slices#23
RejectKid merged 1 commit into
masterfrom
fix-array-backed-slice

Conversation

@RejectKid

@RejectKid RejectKid commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • normalize generated byte-array sources to writable or read-only spans before slicing
  • cover aligned and specialized-width accessors at nonzero byte offsets
  • document the fix in the changelog

Root cause

The optimized storage generator treated byte arrays as span-backed storage but emitted the raw array expression. Fields beginning after the first byte therefore generated an invalid array .Slice(...) call.

Validation

  • dotnet test BitsKit.sln --configuration Release --no-restore
  • .NET 8: 4,603 passed
  • .NET 10: 4,603 passed

@RejectKid
RejectKid marked this pull request as ready for review July 22, 2026 16:54
@RejectKid
RejectKid merged commit 444a1db into master Jul 22, 2026
7 checks passed
@RejectKid
RejectKid deleted the fix-array-backed-slice branch July 22, 2026 16:54
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