The following was failing with a VerifyError on the Flash target and now is failing on native compilation on C++:
This is of course not normally written, but it can happen that Void is inferred through type parameters when void-returning callbacks are involved, like in this simplified example:
class C<T> {
var v:T;
public function new(v:T) this.v = v;
public function next<S>(f:()->S):C<S> return new C(f());
public function handle(cb:T->Void) {cb(v);}
}
function returnVoid() {}
function main() {
new C().next(returnVoid).handle(_ -> {});
}
Since this is passing haxe type checking all the way to the native compilation, it would be nice to get it fixed.
We can consider this a preparation for HaxeFoundation/haxe-evolution#76. For Flash for now I just made the generator generate the wildcard type (*) when Void is used for non-return-type. Maybe something similar could/should be done for C++.
The following was failing with a
VerifyErroron the Flash target and now is failing on native compilation on C++:This is of course not normally written, but it can happen that
Voidis inferred through type parameters when void-returning callbacks are involved, like in this simplified example:Since this is passing haxe type checking all the way to the native compilation, it would be nice to get it fixed.
We can consider this a preparation for HaxeFoundation/haxe-evolution#76. For Flash for now I just made the generator generate the wildcard type (
*) when Void is used for non-return-type. Maybe something similar could/should be done for C++.