Replace removed ** array-repetition operator with @splat (fixes Zig master CI)#56
Conversation
Zig master (0.17.0-dev) removed the ** array-multiplication operator, breaking the Zig master CI job across 39 files. Replace all single-element repeats with @Splat (supported since 0.14) and comptime string repeats with "prefix" ++ @as([N]u8, @Splat(c)) concatenation. Verified with zig build test on both 0.15.2 and 0.17.0-dev.813. Refs #55
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (39)
📝 WalkthroughWalkthroughThis PR systematically refactors fixed-size array initialization across 40+ files from Zig's ChangesArray initialization migration to
🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What
Replaces all 360 uses of the
**array-repetition operator with@splat(and"prefix" ++ @as([N]u8, @splat(c))for comptime hex/separator strings).Why
Zig master (0.17.0-dev) removed the
**operator, so the Test / Zig master CI jobs fail on every file that uses it (the parser now lexes**as two*tokens and reports "binary operator '*' has whitespace on one side, but not the other"). This was breaking CI on all open PRs.How
[_]u8{X} ** N→@as([N]u8, @splat(X))(mechanical, 354 sites): [N]u8 = .{X} ** N→= @splat(X)"0x" ++ "00" ** 32→"0x" ++ @as([64]u8, @splat('0'))(still coerces to[]const u8since the concat result is*const [N:0]u8)@splaton arrays is supported since Zig 0.14, so the minimum supported version (0.15.2) is unaffected.Verification
zig build test+zig fmt --checkpass on 0.15.2 (make ci)zig build testpasses on 0.17.0-dev.813+2153f8143 (previously failed with 34 compile errors)Note:
zig buildof the bench CLI and the examples still have separate 0.17-dev std-API breakages (std.process.argsremoval etc.) not exercised by CI; tracked under #55.Refs #55
🤖 Generated with Claude Code
Summary by CodeRabbit