fix: resolve closure/fn-pointer struct-field call types (issue 0201)

Calling a closure or function-pointer value stored in a struct data field
(`box.run(args)`) typed the call as 'unresolved': value returns marshalled
as garbage, failable fields could not be try/catch-ed. Lowering already
dispatched these (call_closure / call_indirect); only CallResolver.plan
lacked a field-access arm. Add a closure/fn-pointer field arm to plan
(before the instance-method check, mirroring lowering's precedence — a
closure-typed field shadows a same-named method) and extend the lowering
closure-field arm to also handle bare .function fields via call_indirect.

Lock: examples/closures/0315-closures-struct-field-call.sx.
This commit is contained in:
agra
2026-06-28 09:18:30 +03:00
parent 69a6ecfb57
commit 45bd561a0d
7 changed files with 201 additions and 0 deletions