class Sample {
static function main() {
var serializer = new hxbit.Serializer();
var serializedA = serializer.serialize(new AElement());
trace(serializedA.toHex());
}
}
class Element implements hxbit.Serializable {
}
class AElement extends Element {
public function new() {}
}
lua: Conflicting CLID between Element and AElement
stack traceback:
[C]: in function 'error'
sample.lua:640: in field 'initClassIDS'
sample.lua:535: in field 'super'
sample.lua:529: in field 'new'
sample.lua:515: in field 'main'
sample.lua:6708: in main chunk
[C]: in ?
Error: Command failed with error 1
class Sample {
static public function main(): Void {
var v = 14337447;
var v1 = Std.int(v * 223 + 101);
var v2 = Std.int(v1 * 223 + 101);
trace(v1);
trace(v2);
}
}
Sample.hx
lua.hxml
result
This is a bug that occurs because the result of Std.int is unspecified, when argument is outside of the signed int 32 range. https://github.com/HeapsIO/hxbit/blob/c8af5cdbd7c867f9a0bb144aa54a0d2f7f27643e/hxbit/Serializer.hx#L52-L60
I looked into it further.
lua-vanilla returns same value, when over 2147483647. Do you have a plan?