class Main {
static function main() {
var instance:Dynamic = {};
trace(instance.field); //ok
trace(({}:Dynamic).timeout); //ok
var instance = ({}:Dynamic);
trace(instance.field); //runtime error
}
}
$ haxe -main Main -python test.py && python3 test.py
None
None
Traceback (most recent call last):
File "bin/test.py", line 741, in <module>
Main.main()
File "bin/test.py", line 46, in main
print(str(_hx_AnonObject({}).field))
AttributeError: '_hx_AnonObject' object has no attribute 'field'