In the recent HaxeUp talk somebody mentioned inline delegates support in Haxe 4.x and I am looking for an example of how this works.
I would expect something like this (this does not compile):
static function performOperation(a: Int, b: Int, operation: (Int, Int) -> Int): Int {
return inline operation(a, b);
}
static inline function multiply(a: Int, b: Int): Int {
return a * b;
}
to result in a single function call (performOperation) while multiply would be inlined.
You can do this and it will work:
JS output: