I suspect that I need to specify some type, because it is unable to infer the correct ones.
Any hint about how to fix them?
Thanks
EDIT:
in the called function buildFromAnonymous I have modified a line
var e = haxe.macro.Expr.ExprDef.EObjectDecl(fields.map(function(field)#if ((haxe_ver >= 4.0) && !macro ) :haxe.macro.Expr.ObjectField #end {
to var e = haxe.macro.Expr.ExprDef.EObjectDecl(fields.map(function(field)#if (haxe_ver >= 4.0) :haxe.macro.Expr.ObjectField #end {
as explained here
and now it works, even if I had to change a lot of other things.
One thing that remains unchanged is the use of Utf8 even if it is deprectated in favour of UnicodeString: the new class is not compatible, it is not sufficient to change the class…
I have literally replaced the official versions, so there shouldn’t be any doubt that it was using the dev ones.
I had to go back to the previous ones to continue the development.
Ok, I got rid of the Utf8 warnings, to replace the calls to the static methods of Utf8 you just need to cast the target variable to UnicodeString and call the corresponding (non static) functions:
e.g.: Utf8.length(str)
becomes cast(str, UnicodeString).length
Note that the UnicodeString function corresponding to Utf8.sub is .substr, so
This fixes all warning, please tell me if it is the correct approach.
I think that when Haxe 4 will be released officially all libraries will be fixed, but in the meanwhile I prefer to fix them myself, if possible.