I discovered that the following code does not compile anymore. I don't know how exactly @:generic should work, but it looks very strange that the first call to doF does not yield any error, but the followings call failed with a message that does not make much sense.
First bad commit https://github.com/HaxeFoundation/haxe/commit/3c07ce1569df6daf03a4fa4a8ab520af5273759a.
using Test.ArrayExtension;
class Test {
public static function doF2<T>(f: T -> Float) : T {
var arr = [];
arr.doF(f); // Ok
arr.doF(f); // error: doF2.T should be doF2.T Cannot create field doF_doF2_T due to type mismatch
return arr.doF(f); // error: doF2.T should be doF2.T Cannot create field doF_doF2_T due to type mismatch
}
static public function main() {
}
}
class ArrayExtension {
@:generic
public static function doF<T>(array: Array<T>, f: T -> Float) : T {
return null;
}
}
I discovered that the following code does not compile anymore. I don't know how exactly
@:generic
should work, but it looks very strange that the first call to doF does not yield any error, but the followings call failed with a message that does not make much sense. First bad commit https://github.com/HaxeFoundation/haxe/commit/3c07ce1569df6daf03a4fa4a8ab520af5273759a.