Commit 234b2652
234b26524e2fMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified
Description
fix(codegen): method-ref direct call routes args through with_defaults
compile_dot_call_expr's static-alias path (m.call(args) where
m = method(:foo) rewrote the call to a direct sp_foo(args))
used compile_call_args which doesn't coerce arg types. With
promote-mode-widened param slots, a literal int arg flowed into a
sp_Bigint * param raw.
Switch to compile_call_args_with_defaults(nid, mi) so each
positional arg routes through compile_expr_for_expected_type and
picks up the int <-> bigint coerce.
Promote-mode test count: 526 pass / 49 fail / 43 error -> 526 pass / 50 fail / 42 error. Default raise mode unchanged at 618 / 0 / 0.
Co-Authored-By: Claude Opus 4.7 [email protected]
Details
- Commit
- 234b26524e2f
- Parent
- b498aea6aba1
spinel_codegen.rbmodifiedView file
ref_mname = @method_ref_names[ri] mi = find_method_idx(ref_mname) if mi >= 0 return "sp_" + sanitize_name(ref_mname) + "(" + compile_call_args(nid) + ")" # Use compile_call_args_with_defaults so the call routes # each arg through compile_expr_for_expected_type — picks # up promote-mode bigint coerce for an int literal flowing # into a sp_Bigint * param slot. return "sp_" + sanitize_name(ref_mname) + "(" + compile_call_args_with_defaults(nid, mi) + ")" end end ri = ri + 1