Wow how did I missed that, I will check if we must init all fields or we could init as much as we want, this should go in the main haxe docs, that way we could streamline our functional powers.
function test(test_me):SomeType{
return if (testme){
{aaa:1};
} else {
{bbb:2};
}
}
//vs
function test(test_me):SomeType{
return if (testme){
var out=new SomeType();//or some constructor
out.aaa=1;
out;
} else {
var out=new SomeType();//or some constructor
out.bbb=2;
out;
}
}