Commit 9ad6108b

9ad6108be22eMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 2 files · +1 added · ~1 modified

Description

Merge pull request #139 from ryanseys/rs-fix-interp-method-widening

fix(codegen): walk @nd_parts in scan_new_calls

Details

Commit
9ad6108be22e
Parent
8bb1300c0856
Merge parent
e71675689df9

spinel_codegen.rbmodifiedView file

@@ -6452,6 +6452,16 @@
64526452 scan_new_calls(conds[k])
64536453 k = k + 1
64546454 end
6455+ # InterpolatedStringNode and friends carry their components in @nd_parts.
6456+ # Without this, an EmbeddedStatementsNode inside `"#{...}"` is the only
6457+ # call site for a method whose param type would otherwise widen, and
6458+ # the param keeps its default `int` => C error at the call site.
6459+ parts = parse_id_list(@nd_parts[nid])
6460+ k = 0
6461+ while k < parts.length
6462+ scan_new_calls(parts[k])
6463+ k = k + 1
6464+ end
64556465 end
64566466
64576467 def update_ivar_types_from_params