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

@@ -14872,7 +14872,11 @@
1487214872 ref_mname = @method_ref_names[ri]
1487314873 mi = find_method_idx(ref_mname)
1487414874 if mi >= 0
14875- return "sp_" + sanitize_name(ref_mname) + "(" + compile_call_args(nid) + ")"
14875+ # Use compile_call_args_with_defaults so the call routes
14876+ # each arg through compile_expr_for_expected_type — picks
14877+ # up promote-mode bigint coerce for an int literal flowing
14878+ # into a sp_Bigint * param slot.
14879+ return "sp_" + sanitize_name(ref_mname) + "(" + compile_call_args_with_defaults(nid, mi) + ")"
1487614880 end
1487714881 end
1487814882 ri = ri + 1