Repository navigation
A boxed File::Stat#mode arm answers the oint its dispatch holds - #8470
Conversation
A user class whose `mode` reader can be nil shares the poly dispatch with File::Stat#mode (the boxed IO arm). Since Integer nil moved out of band (a07741f, matz#8421) that dispatch's value is an sp_oint, but the stat arm still answered sp_stat_mode's bare sp_int, so the C did not compile: error: incompatible types when assigning to type 'sp_oint' from type 'sp_int' The stat fields were already right (sp_stat_field answers an oint); mode now takes the same wrapping when the call's value is an oint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is evident. The change preserves the optional-integer result in mixed mode dispatch, and the regression test covers nil, integer, and stat values. Pre-merge checks |
|
Since #8421 (a07741f, "Integer and Float nil out of band", merged with the #8427 stack), a user class with a
modereader that reaches the poly dispatch fails to compile:The dispatch's value is an
sp_oint, and the File::Stat default arm (emit_call_poly_io_arms) answeredsp_stat_mode's baresp_int. The stat fields were already right, becausesp_stat_fieldreturns an oint.modenow takessp_oint_of(...)whennode_is_oint(c, id).Bisect: 108d210 good, a45a2d4 (merge of #8427) bad; within the stack, a07741f is the first bad commit. Found in roundhouse CI, where the blog's
runtime/tep/broadcast.rb(sub.mode == 0on a subscription) stopped compiling. The full roundhouse blog spinel build passes with this change.Test:
test/poly_mode_oint_beside_stat.rb. It also stores a realFile::Statin the same dispatch, and the output matches CRuby. Localmake test: 6920 pass, 0 fail.🤖 Generated with Claude Code
Summary by CodeRabbit
moderesults for calls that can return either an integer ornil, preserving the expected output when used alongside file status checks.modevalues with file status modes.