Commit 9453d99f

9453d99fb18dMerged

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

Description

Merge pull request #137 from companygardener/codex/fix-implicit-self-param-poly

fix(codegen): widen implicit self call params

Details

Commit
9453d99fb18d
Parent
8d52d1fd69a1
Merge parent
5de1f422b020

spinel_codegen.rbmodifiedView file

@@ -9376,11 +9376,7 @@
93769376 while kk < arg_ids.length
93779377 at = infer_type(arg_ids[kk])
93789378 if kk < ptypes.length
9379- if ptypes[kk] == "int"
9380- if at != "int"
9381- ptypes[kk] = at
9382- end
9383- end
9379+ ptypes[kk] = unify_call_types(ptypes[kk], at, arg_ids[kk])
93849380 end
93859381 kk = kk + 1
93869382 end
@@ -19481,6 +19477,11 @@
1948119477 at = infer_type(arg_ids[k])
1948219478 if k < ptypes.length
1948319479 pt = ptypes[k]
19480+ if pt == "poly"
19481+ result = result + box_expr_to_poly(arg_ids[k])
19482+ k = k + 1
19483+ next
19484+ end
1948419485 if at == "int"
1948519486 if is_obj_type(pt) == 1
1948619487 # Cast int to object pointer