fix: support optional custom formats#15
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 5 minutes.Comment |
907f0cc to
01e29bc
Compare
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Nice, I'm glad someone else found use for these formatting methods. |
Summary
msgpackFormat()Bug
The pack/unpack paths already strip optional wrappers into
Type = NonOptional(T)when checking for custom methods, but some call sites still invoked those methods onT.For optional values such as
?MyStructor?MyUnion, that meant the code detectedMyStruct.msgpackFormat()orMyUnion.msgpackFormat(), then tried to call?MyStruct.msgpackFormat()or?MyUnion.msgpackFormat(). Those optional types do not have the custom methods, so optional custom formats failed at compile time.The same issue affected custom struct field keys during optional struct unpacking: the field enum and
msgpackFieldKey()lookup usedTinstead of the non-optional struct type.The new tests demonstrate the compile failures first for optional custom struct and union formats.
Tests
zig build test --summary allfailed before the fix with optional custom format compile errors./check.sh --ci