Commit fdce862b

fdce862be17fMerged

Dmitry Bochkarev <[email protected]> · 6 months ago · 3 files · +2 added · ~1 modified

Description

fix(codegen): forward literal blocks in class method dispatch

compile_constant_recv_expr dispatched class methods via sp_cls(args) but never forwarded literal blocks through block_forward_expr. Instance method dispatch already does this; mirror the pattern by checking if the last param is 'proc' and appending sp_proc_new(...).

Details

Commit
fdce862be17f
Parent
b7f2a1bb8737

spinel_codegen.rbmodifiedView file

@@ -17148,6 +17148,17 @@
1714817148 end
1714917149 end
1715017150 end
17151+ has_block_param_239 = (owner_pt.length > 0 && owner_pt.last == "proc") ? 1 : 0
17152+ if has_block_param_239 == 1
17153+ block_proc = block_forward_expr(nid)
17154+ if block_proc != ""
17155+ if ca != ""
17156+ ca = ca + ", " + block_proc
17157+ else
17158+ ca = block_proc
17159+ end
17160+ end
17161+ end
1715117162 end
1715217163 if ca != ""
1715317164 return "sp_" + owner_name + "_cls_" + sanitize_name(mname) + "(" + ca + ")"