On Sun, 23 Apr 2017 11:29:33 GMT, Sönke Ludwig wrote:
I got a bit confused, thinking that
alias this
is indeed used by the serializer by accident (it is not explicitly supported at the moment) and had to postpone the analysis. What I think happens instead is that the serialized output contains both, thedata
array and acnvrt
field, because read+write properties are serialized like ordinary fields.The easiest fix for this would be to annotate the
cnvrt
properties with@ignore
. To make things a bit more pretty, the struct could alternatively also be represented as a single binary blob by definingtoRepresentation
andfromRepresentation
methods:struct compressedString { // ... ubyte[] toRepresentation() { return data; } static compressedString fromRepresentation(ubyte[] data) { compressedString ret; ret.data = data; return ret; } }
Ah, that's nice, decoupling serialization from everything else. Thank you.
I can confirm that your working hypothesis is correct, i.e. that the serialized output contains both the compressed data
and a cnvrt
field.