Quirrel4.41.0

types.Instance.getfuncinfos

Method on every instance
instance.getfuncinfos(): any

Describes this instance's class's _call metamethod, the same way function.getfuncinfos describes a plain function.

examples/types/instance/getfuncinfos-basic.nut
class Blaster {
  function _call(target) { return target != null }
}
let info = Blaster().getfuncinfos()
println("info.name =", info.name)
Output:
info.name = _call

Return value

null if the instance's class defines no _call metamethod (so the instance cannot be called like a function). Otherwise the introspection table for that metamethod closure: name, parameters, defparams, required_params, varargs, native, and the rest.

Notes

Equivalent to getclass().getfuncinfos(). Not about constructor, which is a plain method and never consulted here.

Example

examples/types/instance/getfuncinfos.nut
class Plain { x = 1 }
println("Plain().getfuncinfos() =", Plain().getfuncinfos())
Output:
Plain().getfuncinfos() = null

See also

getmetamethodLooks up one of this instance's class's metamethods by name, without triggering it.
getfuncinfosDescribes the class's _call metamethod, the same way function.getfuncinfos describes a plain function.
getfuncinfosReturns a table describing the closure: its name, parameters, and other introspection data the VM tracks for it.
instanceclass index