libmir / asdf

JSON library
http://asdf.libmir.org
Boost Software License 1.0
20 stars 8 forks source link

Cannot serialize Duration #4

Open fyfrey opened 4 years ago

fyfrey commented 4 years ago

Hi, asdf fails to serialize a struct with phobos Duration in it:

/+dub.sdl:
dependency "asdf" version="~>0.5.7"
+/
import std.stdio;
import std.datetime;
import asdf;
void main()
{
    A a;
    string json = serializeToJsonPretty(a); // never ends
    writeln("json length ", json.length);
}

struct A
{
    Duration dur;
}

This errors with an OOM exception in the appender. Somehow in writes never-ending zero": { strings to it.