Skip to content

API Reference / @gtkx/runtime / callVfunc

Function: callVfunc() ​

callVfunc(owner, key, instance, inputs): unknown

Defined in: packages/runtime/src/vfunc-call.ts:261

Calls a virtual-function slot for a generated vfunc member.

Parameters ​

owner ​

AnyClass

Wrapper class or interface declaring the slot.

key ​

string

Generated member name, such as vfuncMeasure.

instance ​

object

Instance to invoke the slot on.

inputs ​

unknown[]

Arguments passed to the slot.

Returns ​

unknown

Remarks ​

The slot comes from the nearest generated wrapper in the instance's ancestry, so super calls the replaced implementation without re-entering the override. If that wrapper does not implement the interface owning the slot, use the interface's default vtable: a subclass adopted the interface, replacing that default.

Arguments follow the override convention. Pure out parameters are omitted and returned instead; multiple outputs form a tuple.

Throws ​

If the owner declares no matching slot, the instance has no wrapper ancestor, or the resolved vtable slot is empty.