On the subject
I have had serious problems using Reflect.setField and Reflect.setProperty
across targets, I'm not sure if this has been addressed for the 3.2
release?
I suspect that if we have "typed as dynamic breaks property access"
enforced as a feature, then we'll need to rely more on reflection and
other features like that.
This is what I had to use in Actuate:
if (Reflect.hasField (target, propertyName)) {
#if flash
untyped target[propertyName] = value;
#else
Reflect.setField (target, propertyName, value);
#end
} else {
#if (haxe_209 || haxe3)
Reflect.setProperty (target, propertyName, value);
#end
}
Unless it has gotten better since I last checked, the documentation
suggested that "Reflect.setField" should work (basically) in all cases
except Haxe getters and setters, while "Reflect.setProperty" should work
in all cases. I have experiences with "Reflect.setProperty" not working
for ordinary fields, and Flash native properties (get/set in Flash, not in
Haxe) behaving unusually as well.
It's been so long, I can't see which platform and which exact issue, but
this is something that may become more important, and (ideally) should be
wrapped in a single function call instead of this type of thing.
Hopefully generics are also stable enough in Haxe 3.2 that we can use them
to help solve this type of issue as well
Thanks
On Mon, 02 Mar 2015 04:56:21 -0800, Nicolas Cannasse <
ncan...@gmail.com>
wrote: