Open girvel opened 1 month ago
But sometimes I actually need to make something with a shared metatable static. For example, the sound of the action surge. Maybe there is a point to remove if not mt.serialize completely, then static's serialize; it would look like Dump.serializers[t] and it would not mess with metatables at all. Static also changes __newindex by force, so it should be changed only if the table does not have a metatable yet.
Work is saved at static-rework
static
overwriting__serialize
s generated by otherstatic
s is a feature, allowing for cascadestatic
tables. But overwriting__serialize
in general can cause issues. For example, Vectors shouldn't be marked as statics ever, because they have a shared metatable. One Vector marked asstatic
and all vectors when serialized will return the same vector. So, metatables that should be shared should repelstatic
and cause an error when marked with it. I will definitely forget about marking some shared metatable as repelling and create a headache-causing bug, so probably all metatables not containing__allow_static
should repelstatic
by default. Maybe if there is a wide demand for marking metatabled objects withstatic
we can dostatic.unsafe
sugar, but I highly doubt that we'll need that.