On Monday, 28 August 2023 at 19:07:39 UTC, user1234 wrote:
>On Sunday, 27 August 2023 at 19:39:05 UTC, GrimMaple wrote:
>[...]
I tried to make it as universal as I could, but any suggestions are welcome for a discussion.
I had a quick look yesterday. One thing I have noticed is that virtual setter/getters dont seem to be supported.
I took a quick look and I don't think I fully understood what you meant. Meanwhile, I made a small snippet of how I understood your point, here's an example:
@safe unittest
{
static class A
{
@serializable int b() @safe { return 0; }
}
static class B : A
{
override int b() @safe { return 1; }
}
B b = new B();
assert(serializeToJSONString(cast(A)b) == `{"b":1}`);
}
I don't know if it's what you expected, but this unittest passes.