Closed AdrianV closed 6 years ago
Any updates on this? Got the similar behaviour on Java target.
class PlaceStruct implements hxbit.Serializable {
@s public var name:String;
@s public var address:String;
public function new(name:String, address:String) {
this.name = name;
this.address = address;
}
}
//--------------------------
//Call constructor anywhere:
new PlaceStruct("Name", "Address"); // java.lang.ExceptionInInitializerError
Did I miss something?
Seems strange, we insert with macros a static var __clid = hxbit.Serializer.registerClass(MyClass)
in all classes implementing hxbit.Serializable, which should be called before the Serializer is created.
@waneck what is the status of static var initialization on java output?
Seems like a Haxe issue, not hxbit specific. Closing this issue for now (follow up on referenced haxe issue)
I don't know if it is a bug of the cs and java target or of hxbit. But the following code throws an exception on both targets "Too late to register class" at hxbit.Serializer.registerClass() So I post the issue here.