public operator call(args as Object[]) as ReturnType throws Exception
Direct call operator.
The compiler translates f(args...) to a reflective invocation with an Object[]. This convenience does not turn Invocable into a statically typed function signature.
| Parameter | Description |
|---|---|
args | Arguments as Object array. |
Result of type ReturnType.
import klyn.reflection
f = eval("def twice(x as Int): return x * 2")
if f is Invocable<Int>:
print(f(21)) # 42