Commit 9c714398
9c714398c5e6Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified
Description
fix(codegen): hash literal {sym:} treats bigint values as int slot
infer_hash_val_type's all-sym-keys arm matched only when the
first value type was int / bool / nil, so a promote-widened
bigint value ({weight:} where weight was promoted) fell through
to the str_int_hash default — producing sp_StrIntHash storage
that mismatched the caller's expected sp_SymIntHash return.
Add bigint to the same arm. The matching sp_SymIntHash_set call
site already unboxes bigint values to mrb_int (commit dd073e8),
so storage stays int-shaped and the type tag matches.
Promote-mode test count: 519 pass / 49 fail / 50 error (cleaner intermediate state — hash_shorthand now hits a downstream poly / sym hash mismatch that requires separate inference work). Default raise mode unchanged at 618 / 0 / 0.
Co-Authored-By: Claude Opus 4.7 [email protected]
Details
- Commit
- 9c714398c5e6
- Parent
- bbae0e91c820
spinel_codegen.rbmodifiedView file
end return "str_str_hash" end if all_sym_keys == 1 && (first_vt == "int" || first_vt == "bool" || first_vt == "nil") if all_sym_keys == 1 && (first_vt == "int" || first_vt == "bigint" || first_vt == "bool" || first_vt == "nil") return "sym_int_hash" end # Symbol values get sym_poly_hash storage so dig / lookup