class Main {
static function main() {
var n:Null<Int> = null;
var closure:Null<Int>->Void = printA;
closure(n);
}
static function printA(a:Int) {
trace(a);
}
}
This has to be solved when we detect the assignment of printA to closure, but I'm not sure what exactly we should do here. The notion of "adapter methods" has come up and I think MethodHandle supports that somehow, but my brain can't handle any more Java documentation for the moment.
https://github.com/HaxeFoundation/haxe/issues/4342 is still a big problem. This code causes a NullPointerException:
This has to be solved when we detect the assignment of
printA
toclosure
, but I'm not sure what exactly we should do here. The notion of "adapter methods" has come up and I thinkMethodHandle
supports that somehow, but my brain can't handle any more Java documentation for the moment.Note that this fails on genjava too.