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
end1714917149
end1715017150
end17151+
has_block_param_239 = (owner_pt.length > 0 && owner_pt.last == "proc") ? 1 : 017152+
if has_block_param_239 == 117153+
block_proc = block_forward_expr(nid)17154+
if block_proc != ""17155+
if ca != ""17156+
ca = ca + ", " + block_proc17157+
else17158+
ca = block_proc17159+
end17160+
end17161+
end1715117162
end1715217163
if ca != ""1715317164
return "sp_" + owner_name + "_cls_" + sanitize_name(mname) + "(" + ca + ")"test/cls_meth_block.rbaddedView file
Loading diff…
test/cls_meth_block.rb.expectedaddedView file
Loading diff…