Code Monkey home page Code Monkey logo

mir-ion's People

Contributors

9il avatar gallafrancesco avatar geod24 avatar hatf0 avatar kinke avatar thewilsonator avatar webfreak001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mir-ion's Issues

implementing custom (de)serializer guide

I think mir-ion is a great base for (de)serializers, as it already includes a few formats I think it would be interesting for users to know how to extend it to add their own ones.

Deprecation in current version

../../.dub/packages/mir-ion-2.1.6/mir-ion/source/mir/deser/package.d(401,56): Deprecation: scope variable `data` assigned to non-scope parameter `value` calling `deserializeFromIon`

Cannot build library with LLDC

While compiling serve-d with LLDC 1.28.0 (DMD v2.098.0, LLVM 11.1.0) on Linux Mint x86_64, when it got to compile mir-ion, it spewed these error messages:

    Building mir-ion 2.2.0: building configuration [library]
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/csv.d(234,30): Deprecation: returning `Row(&this, this.nColumns)` escapes a reference to parameter `this`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/csv.d(234,30):        perhaps remove `scope` parameter annotation so `return` applies to `ref`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @nogc @safe) const`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9):        ... (19 more, -v to show) ...
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/package.d(981,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(IonSerializer!(32768u, ["data"], false))` error instantiating
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/ion.d(444,19):        instantiated from here: `serializeValue!(IonSerializer!(32768u, ["data"], false), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/benchmark.d(68,25):        instantiated from here: `serializeIon!(ScopedBuffer!(ubyte, 4096LU), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @nogc @safe) const`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9):        ... (19 more, -v to show) ...
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/package.d(981,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(JsonSerializer!("", ScopedBuffer!(char, 4096LU)))` error instantiating
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/json.d(584,23):        instantiated from here: `serializeValue!(JsonSerializer!("", ScopedBuffer!(char, 4096LU)), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/benchmark.d(73,26):        instantiated from here: `serializeJsonPretty!(ScopedBuffer!(char, 4096LU), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @nogc @safe) const`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9):        ... (19 more, -v to show) ...
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/package.d(981,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(MsgpackSerializer!(ScopedBuffer!(ubyte, 4096LU)))` error instantiating
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/msgpack.d(634,19):        instantiated from here: `serializeValue!(MsgpackSerializer!(ScopedBuffer!(ubyte, 4096LU)), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/benchmark.d(78,29):        instantiated from here: `serializeMsgpack!(ScopedBuffer!(ubyte, 4096LU), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @safe) const`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9):        ... (19 more, -v to show) ...
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/package.d(981,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(JsonSerializer!("", Appender!(char[])))` error instantiating
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/json.d(584,23):        instantiated from here: `serializeValue!(JsonSerializer!("", Appender!(char[])), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/json.d(596,28):        instantiated from here: `serializeJsonPretty!(Appender!(char[]), const(IonValueStream))`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/conv.d(229,31):        instantiated from here: `serializeJsonPretty!(IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/json.d(597,53): Error: forward reference to inferred return type of function call `function () @trusted => cast(string)app.data()`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/conv.d(229,31): Error: `pure` function `mir.ion.conv.ion2json` cannot call impure function `mir.ser.json.serializeJsonPretty!"".serializeJsonPretty!(IonValueStream).serializeJsonPretty`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @safe) const`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9):        ... (19 more, -v to show) ...
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/package.d(981,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(JsonSerializer!("\x09", Appender!(char[])))` error instantiating
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/json.d(584,23):        instantiated from here: `serializeValue!(JsonSerializer!("\x09", Appender!(char[])), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/json.d(596,28):        instantiated from here: `serializeJsonPretty!(Appender!(char[]), const(IonValueStream))`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/conv.d(256,31):        instantiated from here: `serializeJsonPretty!(IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/json.d(597,53): Error: forward reference to inferred return type of function call `function () @trusted => cast(string)app.data()`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/conv.d(256,31): Error: `pure` function `mir.ion.conv.ion2jsonPretty` cannot call impure function `mir.ser.json.serializeJsonPretty!().serializeJsonPretty!(IonValueStream).serializeJsonPretty`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @safe) const`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9):        ... (19 more, -v to show) ...
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/package.d(981,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(TextSerializer!("", Appender!(char[])))` error instantiating
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/text.d(725,23):        instantiated from here: `serializeValue!(TextSerializer!("", Appender!(char[])), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/text.d(682,28):        instantiated from here: `serializeTextPretty!(Appender!(char[]), IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/text.d(512,34):        instantiated from here: `serializeTextPretty!("", IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/conv.d(389,31):        instantiated from here: `serializeText!(IonValueStream)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/text.d(683,49): Error: forward reference to inferred return type of function call `function () @trusted => cast(string)app.data()`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/conv.d(389,31): Error: `pure` function `mir.ion.conv.ion2text` cannot call impure function `mir.ser.text.serializeText!(IonValueStream).serializeText`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @safe) const`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ion/stream.d(321,9):        ... (19 more, -v to show) ...
../../.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/ser/package.d(981,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(TextSerializer!("\x09", Appender!(char[])))` error instantiating
Error ldc2 failed with exit code 1.

Oddly though, compiling with DMD v2.104.0 seems to work. Perhaps the library's codebase should remain compatible with older versions of the DMD frontend?

ion2json not working

I'm trying to get a JSON representation of IonDescribedValue like so:

IonException deserializeFromIon(scope const char[][] symbolTable, IonDescribedValue v)
{
	import mir.ion.value;
	import mir.ion.conv;

	rawJson = ion2json(inputValue.data);
	return null;
}

however this ends in this exception:

mir.ion.exception.IonException@../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/exception.d(284): IonException: unexpected end of data
----------------
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:41 pure @nogc @safe int mir.ion.stream.IonValueStream.opApply(scope int delegate(const(char[])[], mir.ion.value.IonDescribedValue) pure @nogc @safe).__lambda2(mir.ion.exception.IonErrorCode, const(char[])[], mir.ion.value.IonDescribedValue) [0x5596b6b516fc]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:233 const pure nothrow @nogc scope @trusted int mir.ion.stream.IonValueStream.opApply(scope int delegate(mir.ion.exception.IonErrorCode, const(char[])[], mir.ion.value.IonDescribedValue) pure nothrow @nogc @safe) [0x5596b6b51b6e]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:247 const pure @nogc scope @trusted int mir.ion.stream.IonValueStream.opApply(scope int delegate(mir.ion.exception.IonErrorCode, const(char[])[], mir.ion.value.IonDescribedValue) pure @nogc @safe) [0x5596b6b51eef]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:39 const pure @nogc scope @safe int mir.ion.stream.IonValueStream.opApply(scope int delegate(const(char[])[], mir.ion.value.IonDescribedValue) pure @nogc @safe) [0x5596b6b516c2]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:54 const pure scope @trusted int mir.ion.stream.IonValueStream.opApply(scope int delegate(const(char[])[], mir.ion.value.IonDescribedValue) pure @safe) [0x5596b6b5178b]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:321 const pure @safe void mir.ion.stream.IonValueStream.serialize!(mir.ser.json.JsonSerializer!("", std.array.Appender!(char[]).Appender).JsonSerializer).serialize(ref mir.ser.json.JsonSerializer!("", std.array.Appender!(char[]).Appender).JsonSerializer) [0x5596b6b4f1ea]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ser/package.d:735 pure @safe void mir.ser.serializeValue!(mir.ser.json.JsonSerializer!("", std.array.Appender!(char[]).Appender).JsonSerializer, mir.ion.stream.IonValueStream).serializeValue(ref mir.ser.json.JsonSerializer!("", std.array.Appender!(char[]).Appender).JsonSerializer, ref mir.ion.stream.IonValueStream) [0x5596b6b4f1b7]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ser/json.d:566 pure @safe void mir.ser.json.serializeJsonPretty!("").serializeJsonPretty!(std.array.Appender!(char[]).Appender, mir.ion.stream.IonValueStream).serializeJsonPretty(ref std.array.Appender!(char[]).Appender, ref mir.ion.stream.IonValueStream, int) [0x5596b6b4f178]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ser/json.d:578 pure @safe immutable(char)[] mir.ser.json.serializeJsonPretty!("").serializeJsonPretty!(mir.ion.stream.IonValueStream).serializeJsonPretty(ref mir.ion.stream.IonValueStream, int) [0x5596b6b4f117]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ser/json.d:378 pure @safe immutable(char)[] mir.ser.json.serializeJson!(mir.ion.stream.IonValueStream).serializeJson(mir.ion.stream.IonValueStream, int) [0x5596b6b4f0ea]
../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/conv.d:183 pure @safe immutable(char)[] mir.ion.conv.ion2json(scope const(ubyte)[]) [0x5596b6b4d514]
source/served/lsp/protocol.d:95 mir.ion.exception.IonException served.lsp.protocol.JsonToken.deserializeFromIon(scope const(char[][]), mir.ion.value.IonDescribedValue) [0x5596b68ed4c7]
../../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/package.d:479 mir.ion.exception.IonException mir.deser.deserializeValue!(null).deserializeValue!(served.lsp.protocol.JsonToken, 0, false).deserializeValue(mir.deser.DeserializationParams!(0, false).DeserializationParams, ref served.lsp.protocol.JsonToken) [0x5596b691fc30]
../../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/json.d:107 void mir.deser.json.deserializeJsonImpl!(false).deserializeJsonImpl!(served.lsp.protocol.JsonToken).deserializeJsonImpl(ref served.lsp.protocol.JsonToken, scope const(char)[]) [0x5596b691292c]
../../../.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/json.d:50 served.lsp.protocol.JsonToken mir.deser.json.deserializeJsonImpl!(false).deserializeJsonImpl!(served.lsp.protocol.JsonToken).deserializeJsonImpl!().deserializeJsonImpl(scope const(char)[]) [0x5596b69239ab]
source/served/lsp/protocol.d:117 void served.lsp.protocol.__unittest_L100_C1() [0x5596b68ed6b7]
??:? void served.lsp.protocol.__modtest() [0x5596b69f5060]
??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x5596b6b87b8a]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x5596b6b613bb]
??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody2(ref rt.sections_elf_shared.DSO) [0x5596b6b77eab]
??:? int rt.sections_elf_shared.DSO.opApply(scope int delegate(ref rt.sections_elf_shared.DSO)) [0x5596b6b78463]
??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))) [0x5596b6b77e39]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)) [0x5596b6b6138d]
??:? runModuleUnitTests [0x5596b6b879d6]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x5596b6b73060]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x5596b6b72fec]
??:? _d_run_main2 [0x5596b6b72f4d]
??:? _d_run_main [0x5596b6b72ca9]
/usr/include/dlang/dmd/core/internal/entrypoint.d:29 main [0x5596b68c9075]
??:? [0x7f5718ff930f]
??:? __libc_start_main [0x7f5718ff93c0]
??:? _start [0x5596b68c67f4]

when trying to do

assert(deserializeJson!JsonToken(serializeJson(JsonToken("1"))).rawJson == "1");

[Enh] Add interface function with conversionFinalizer dict, and branching on diff column in the library

As discussed elsewhere, add the issue here with the code location:

libmir/mir-algorithm#442 (comment)

You'd better allow user to plug in his own converters for his own data.

It is allowed now. Please check the conversionFinalizer.

conversionFinalizer : (
            unquotedString,
            scalar,
            columnIndex,
            columnName)

So you pass out the columnIndex and columnName to let the user branch in his function to dispatch to different columns? This looks ugly, and may incur code duplication, e.g. two different csv, with col-1, col-2 swapped:

in Python, pass in dict, 2 one-liner:

data1 = np.genfromtxt("data1.csv", ..., converters = {1: cvtr1, 2: cvtr2})
data2 = np.genfromtxt("data2.csv", ..., converters = {2: cvtr1, 1: cvtr2})

But with conversionFinalizer in D:

conversionFinalizer1 (...) {
  switch (columnIndex) {
    1: return cvtr1(unquotedString);
    2: return cvtr2(unquotedString);
  }
}

conversionFinalizer2 (...) {
  switch (columnIndex) {
    1: return cvtr2(unquotedString);
    2: return cvtr1(unquotedString);
  }
}

too verbose.

Why not use the Python dictionary format, and let the Mir do such branching in the library?

Example in D can just follow the Python api:

double cvtr1(string str) {return ...;}
double cvtr2(string str) {return ...;}

data1 = mir.genfromtxt("data1.csv", ...,  [1: cvtr1, 2: cvtr2]);  // D does not have named arg yet, let just use positional arg
data2 = mir.genfromtxt("data2.csv", ...,  [2: cvtr1, 1: cvtr2]);  // pass in D's AA.

provide serializer API function to undo value preamble

I have a custom type like this:

struct NoneType {}
alias Optional(T) = MySumType!(NoneType, T);

// calling `match` on this custom type is blocked by https://issues.dlang.org/show_bug.cgi?id=21975
struct MySumType(Types...)
{
	SumType!Types value;
	alias value this;

	ref typeof(this) opAssign(T)(T rhs)
	{
		value.opAssign(rhs);
		return this;
	}

	void serialize(S)(ref S serializer) const
	{
		import mir.ser : serializeValue;

		value.tryMatch!(
			(NoneType none) { /* no output */ },
			(v) { serializeValue(serializer, v); }
		);
	}
}

struct S { Optional!bool optBool; }

and want it to serialize to completely omit these values, however currently it serializes like this:

{"optBool":}

I would like to be able to check if a key was written and undo the key write in that case. In my use-case it's not possible to have such a value in an array or as standalone serialization, but having some kind of generic way to undo preparations (leading comma, etc) would be nice anyway.

I would work around this by only selectively implementing the JsonSerializer and accessing its internal appender, however it's private so that's not possible. A function to undo the last added key (and reverting state so that commas are properly placed) would be nice to have.

This is a very frequent case in my code base / the protocol I implement, where omission of fields often means something different than set default values or maybe don't even have default values that are predictable before actually having context.

Potential broken statement in deserializer

I came across this while looking through the code, I didn't have any actual issue with this yet, but it seems to be hard to come across because of the extra UDA you would need to even enable this code path.

ionValue = table[id];

this assignment seems to be done in the default case, but

  1. it's missing a break; if it's intended to go out of the switch
  2. if that's the intended way, the ionValue is overriden right afterwards below, (line 863) so this assigned ionValue actually can't be used.

this might be missing a test case?

MessagePack backend implementation

This issue shall serve as a tracker for implementing the MessagePack backend within Ion, replacing the msgpack-d dependency.

TO-DO:

Serialization (complete)

  • Booleans
  • Floats (both 32-bit and 64-bit)
  • Strings
  • Unsigned integers
  • Signed integers
  • bin data type
  • Arrays
  • Maps
  • Using the fix* types (as an optimization)
  • Integration testing / fuzzing

Deserialization

  • Booleans
  • Floats (both 32-bit and 64-bit)
  • Strings
  • Unsigned integers
  • Signed integers
  • bin data type
  • Arrays
  • Maps

Related PRs: #4, #5

IonSymbolTable fails with very large keys

In the MessagePack deserializer, this test fails:

/// Test map with varying key lengths
@safe pure
version(mir_ion_msgpack_test)
unittest
{
    import mir.ion.ser.msgpack : serializeMsgpack;
    import std.array : replicate;

    ubyte[string] map;
    map["c".replicate(ushort.max + 1)] = 0xFF;

    assert(serializeMsgpack(map).deserializeMsgpack!(typeof(map)) == map);
}

I've narrowed this down to this specific line where we grow the key-space.

if (_expect(nextKeyPosition + key.length + 16 > keySpace.length, false))

I believe that this if should actually be a while, otherwise we give up on growing the key-space way too early.

deserializeJson does not handle associative array arrays properly

Reported by @adamdruppe on the D discord, this fails:

import mir.ion.deser.json : deserializeJson;
string d = `[{"test": 1}, {"second": 2}]`;
writeln(d.deserializeJson!(int[string][])); // prints out [[], []]

Upon further investigation, I found that using deserializeDynamicJson works here:

writeln(d.deserializeDynamicJson!(int[string][])); // prints out [["test": 1], ["second": 2]]

Is this intended behavior? I'm assuming that this is a bug -- please advise @9il.

Clobs / blobs behaving strangely within `deserializeValue`

Within mir.deser.deserializeValue, we only try to read blobs / clobs if they are contained within the data type we are trying to deserialize from, and completely fail if a blob / clob is at the top-level (see: not contained within a struct). Is this intended behavior? @9il

deserializeJson not supporting `@serdeProxy!JsonAlgebraic`

since #17 deserializeJson (not deserializeDynamicJson) works with JsonAlgebraic, however it seems when wrapping it in a proxy struct and using @serdeProxy!JsonAlgebraic it doesn't work as expected:

unittest
{
	import mir.serde;
	import mir.algebraic_alias.json;
	import mir.ser.json : serializeJson;
	import mir.deser.json : deserializeJson;
	import std.conv : to;

	@serdeFallbackStruct
	@serdeProxy!JsonAlgebraic
	struct SerdeTest
	{
		JsonAlgebraic value;
	}

	StringMap!JsonAlgebraic object;
	object["foo"] = JsonAlgebraic("bar");

	SerdeTest test = SerdeTest(JsonAlgebraic(object));

	assert(test.serializeJson == `{"foo":"bar"}`);

	assert(test.serializeJson.deserializeJson!SerdeTest == test,
		test.serializeJson.deserializeJson!SerdeTest.to!string ~ " != "
		~ test.to!string);
}

fails with:

bug.d(23): SerdeTest([]) != SerdeTest(["foo": bar])

using deserializeDynamicJson instead of deserializeJson works as expected.

Unexpected IonTypeCode with deserializeIon!(Variant!T)

Reproduction case: (I have SumType as custom type which defines serdeIgnoreOut)

import std.stdio;
import mir.ser.json : serializeJson;
import mir.deser.json : deserializeDynamicJson;

struct SumType(Types...)
{
	import std.sumtype : StdSumType = SumType, match;
	import mir.ion.exception;
	import mir.ion.value;

	StdSumType!Types value;
	alias value this;

	this(T)(T v)
	{
		value = typeof(value)(v);
	}

	void serialize(S)(ref S serializer) const
	{
		import mir.ser : serializeValue;

		value.match!(v => serializeValue(serializer, v));
	}

	IonException deserializeFromIon(scope const char[][] symbolTable, IonDescribedValue inputValue)
	{
		import mir.deser.ion : deserializeIon;
		import mir.algebraic : Variant, match;

		auto alg = deserializeIon!(Variant!Types)(symbolTable, inputValue);
		alg.match!(v => value = v);
		return null;
	}
}

struct Location
{
	string uri;
}

alias LocValue = SumType!(Location[], Location);

void main()
{
	auto v = LocValue(Location("file:///foo.d"));
	auto serialized = v.serializeJson;
	writeln(serialized);
	assert(deserializeDynamicJson!LocValue(serialized) == v);
}
Running a 
{"uri":"file:///foo.d"}
mir.ion.exception.IonException@/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/package.d(1230): Unexpected IonTypeCode for Algebraic!(Location[], Location)
----------------
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/ion.d:60 pure @safe void mir.deser.ion.deserializeIon!(mir.algebraic.Algebraic!(app.Location[], app.Location).Algebraic, false).deserializeIon!().deserializeIon(ref mir.algebraic.Algebraic!(app.Location[], app.Location).Algebraic, scope const(char[][]), mir.ion.value.IonDescribedValue) [0x557dd89137a1]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/ion.d:29 pure @safe mir.algebraic.Algebraic!(app.Location[], app.Location).Algebraic mir.deser.ion.deserializeIon!(mir.algebraic.Algebraic!(app.Location[], app.Location).Algebraic, false).deserializeIon!().deserializeIon(scope const(char[][]), mir.ion.value.IonDescribedValue) [0x557dd891364c]
source/app.d:31 pure mir.ion.exception.IonException app.SumType!(app.Location[], app.Location).SumType.deserializeFromIon(scope const(char[][]), mir.ion.value.IonDescribedValue) [0x557dd890ca51]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/package.d:479 pure mir.ion.exception.IonException mir.deser.deserializeValue!(null).deserializeValue!(app.SumType!(app.Location[], app.Location).SumType, 1, false).deserializeValue(mir.deser.DeserializationParams!(1, false).DeserializationParams, ref app.SumType!(app.Location[], app.Location).SumType) [0x557dd891319a]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/ion.d:59 pure void mir.deser.ion.deserializeIon!(app.SumType!(app.Location[], app.Location).SumType, false).deserializeIon!().deserializeIon(ref app.SumType!(app.Location[], app.Location).SumType, scope const(char[][]), mir.ion.value.IonDescribedValue) [0x557dd891187f]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/ion.d:126 pure int mir.deser.ion.deserializeIon!(app.SumType!(app.Location[], app.Location).SumType, false).deserializeIon!().deserializeIon(ref app.SumType!(app.Location[], app.Location).SumType, scope const(ubyte)[]).__foreachbody3(const(char[])[], mir.ion.value.IonDescribedValue) [0x557dd8911740]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:42 pure @nogc @safe int mir.ion.stream.IonValueStream.opApply(scope int delegate(const(char[])[], mir.ion.value.IonDescribedValue) pure @nogc @safe).__lambda2(mir.ion.exception.IonErrorCode, const(char[])[], mir.ion.value.IonDescribedValue) [0x557dd891ef70]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:233 const pure nothrow @nogc scope @trusted int mir.ion.stream.IonValueStream.opApply(scope int delegate(mir.ion.exception.IonErrorCode, const(char[])[], mir.ion.value.IonDescribedValue) pure nothrow @nogc @safe) [0x557dd891f3b6]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:247 const pure @nogc scope @trusted int mir.ion.stream.IonValueStream.opApply(scope int delegate(mir.ion.exception.IonErrorCode, const(char[])[], mir.ion.value.IonDescribedValue) pure @nogc @safe) [0x557dd891f737]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:39 const pure @nogc scope @safe int mir.ion.stream.IonValueStream.opApply(scope int delegate(const(char[])[], mir.ion.value.IonDescribedValue) pure @nogc @safe) [0x557dd891ef0a]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/ion/stream.d:74 const pure scope int mir.ion.stream.IonValueStream.opApply(scope int delegate(const(char[])[], mir.ion.value.IonDescribedValue) pure) [0x557dd891f093]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/ion.d:124 pure void mir.deser.ion.deserializeIon!(app.SumType!(app.Location[], app.Location).SumType, false).deserializeIon!().deserializeIon(ref app.SumType!(app.Location[], app.Location).SumType, scope const(ubyte)[]) [0x557dd89116e5]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/json.d:417 pure void mir.deser.json.deserializeDynamicJson!(app.SumType!(app.Location[], app.Location).SumType).deserializeDynamicJson(ref app.SumType!(app.Location[], app.Location).SumType, scope const(char)[]) [0x557dd89116a2]
/home/webfreak/.dub/packages/mir-ion-1.0.31/mir-ion/source/mir/deser/json.d:408 pure app.SumType!(app.Location[], app.Location).SumType mir.deser.json.deserializeDynamicJson!(app.SumType!(app.Location[], app.Location).SumType).deserializeDynamicJson(scope const(char)[]) [0x557dd891165f]
source/app.d:49 _Dmain [0x557dd890c9a1]
Program exited with code 1

Latest `mir-ion`, `mir-algorithm` and `mir-core` do not build with any DMD version

I'm trying to build a project which uses Mir, however, the build does not succeed. (I am guessing that it maybe succeeded with older versions of dub.selections.json but the project did not commit its lockfile.)

I reduced the build error to the following:

dmd \
	-I~/.dub/packages/mir-ion/2.2.0/mir-ion/source/ \
	-I~/.dub/packages/mir-algorithm/3.21.0/mir-algorithm/source/ \
	-I~/.dub/packages/mir-core/1.6.0/mir-core/source/ \
	~/.dub/packages/mir-ion/2.2.0/mir-ion/source/mir/yaml/internal/token.d \
	~/.dub/packages/mir-algorithm/3.21.0/mir-algorithm/source/mir/algebraic_alias/ion.d \
	~/.dub/packages/mir-core/1.6.0/mir-core/source/mir/algebraic.d

It fails with:

.../.dub/packages/mir-core/1.6.0/mir-core/source/mir/algebraic.d(1474): Error: `pure` function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` cannot call impure function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals`
.../.dub/packages/mir-core/1.6.0/mir-core/source/mir/algebraic.d(1474): Error: `@nogc` function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` cannot call non-@nogc function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals`
.../.dub/packages/mir-core/1.6.0/mir-core/source/mir/algebraic.d(1474): Error: function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals` is not `nothrow`
.../.dub/packages/mir-core/1.6.0/mir-core/source/mir/algebraic.d(1429): Error: function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` may throw but is marked as `nothrow`
.../.dub/packages/mir-algorithm/3.21.0/mir-algorithm/source/mir/annotated.d(69): Error: template instance `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!()` error instantiating
.../.dub/packages/mir-core/1.6.0/mir-core/source/mir/internal/meta.d(683):        instantiated from here: `U!(Algebraic!(Ion_))`
.../.dub/packages/mir-core/1.6.0/mir-core/source/mir/algebraic.d(858):        12 recursive instantiations from here: `ReplaceTypeUnless!(isVariant, This, Algebraic!(Ion_), typeof(null), bool, long, double, string, Blob, Clob, Timestamp, This[], StringMap!(This), Annotated!(This))`
.../.dub/packages/mir-algorithm/3.21.0/mir-algorithm/source/mir/algebraic_alias/ion.d(60):        instantiated from here: `Algebraic!(Ion_)`

I am not sure where the problem lies, but I tried all recent DMD releases and it doesn't work with any of them.

Potential of moving backends out of the project source tree?

Is there any way that we could split out the individual (de)?serialization backends out from the main source tree, and publish them as separate dub packages? Obviously the Ion / Ion Text implementations should remain, but if we're ever planning on adding more backends (i.e. YAML, Protobuf / Cap'n Proto / etc, Flatbuffers), we should definitely see into whether or not we can split these up into their own separate packages. I believe that there is already some work in that regards (with the ISerializer interface), but is there any other reason why this hasn't happened yet (other then with the Bloomberg components)?

cannot build as library in release mode

When cloning mir-ion, checking out 2.0.16 and running dub build --build=release --config=library the following happens:

dub build --build=release --config=library
Performing "release" build using /usr/bin/dmd for x86_64.
mir-ion 2.0.16: building configuration "library"...
source/mir/ion/internal/data_holder.d(178,24): Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
source/mir/ion/internal/data_holder.d(145,9): Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
source/mir/ion/internal/data_holder.d(155,17): Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
source/mir/ion/internal/data_holder.d(154,55): Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
source/mir/ion/internal/data_holder.d(154,28): Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
source/mir/ion/internal/data_holder.d(152,42): Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
source/mir/ion/internal/data_holder.d(152,13): Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
Error: null dereference in function _D3mir5deser4text__T19IonTextDeserializerTSQBp3ser3ion__T13IonSerializerVki32768VAAyanVbi1ZQBiZQCx5__barFNbZv
/usr/bin/dmd failed with exit code 1.

Broken on windows

See CI or this run log from someone on discord:

C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\csv.d(236,30): Deprecation: returning `Row(&this, this.nColumns)` escapes a reference to parameter `this`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\csv.d(236,30):        perhaps remove `scope` parameter annotation so `return` applies to `ref`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @nogc @safe) const`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9):        ... (19 more, -v to show) ...
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\package.d(979,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(IonSerializer!(32768u, ["data"], false))` error instantiating
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\ion.d(444,19):        instantiated from here: `serializeValue!(IonSerializer!(32768u, ["data"], false), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\benchmark.d(68,25):        instantiated from here: `serializeIon!(ScopedBuffer!(ubyte, 4096LU), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @nogc @safe) const`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9):        ... (19 more, -v to show) ...
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\package.d(979,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(JsonSerializer!("", ScopedBuffer!(char, 4096LU)))` error instantiating
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\json.d(574,23):        instantiated from here: `serializeValue!(JsonSerializer!("", ScopedBuffer!(char, 4096LU)), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\benchmark.d(73,26):        instantiated from here: `serializeJsonPretty!(ScopedBuffer!(char, 4096LU), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @nogc @safe) const`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9):        ... (19 more, -v to show) ...
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\package.d(979,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(MsgpackSerializer!(ScopedBuffer!(ubyte, 4096LU)))` error instantiating
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\msgpack.d(633,19):        instantiated from here: `serializeValue!(MsgpackSerializer!(ScopedBuffer!(ubyte, 4096LU)), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\benchmark.d(78,29):        instantiated from here: `serializeMsgpack!(ScopedBuffer!(ubyte, 4096LU), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @safe) const`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9):        ... (19 more, -v to show) ...
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\package.d(979,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(JsonSerializer!("", Appender!(char[])))` error instantiating
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\json.d(574,23):        instantiated from here: `serializeValue!(JsonSerializer!("", Appender!(char[])), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\json.d(586,28):        instantiated from here: `serializeJsonPretty!(Appender!(char[]), const(IonValueStream))`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\conv.d(229,31):        instantiated from here: `serializeJsonPretty!(IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @safe) const`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9):        ... (19 more, -v to show) ...
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\package.d(979,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(JsonSerializer!("\x09", Appender!(char[])))` error instantiating
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\json.d(574,23):        instantiated from here: `serializeValue!(JsonSerializer!("\x09", Appender!(char[])), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\json.d(586,28):        instantiated from here: `serializeJsonPretty!(Appender!(char[]), const(IonValueStream))`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\conv.d(256,31):        instantiated from here: `serializeJsonPretty!(IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @safe) const`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9):        ... (19 more, -v to show) ...
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\package.d(979,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(TextSerializer!("", Appender!(char[])))` error instantiating
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\text.d(717,23):        instantiated from here: `serializeValue!(TextSerializer!("", Appender!(char[])), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\text.d(675,28):        instantiated from here: `serializeTextPretty!(Appender!(char[]), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\text.d(512,34):        instantiated from here: `serializeTextPretty!("", IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\conv.d(389,31):        instantiated from here: `serializeText!(IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9): Error: none of the overloads of `opApply` are callable using argument types `(int delegate(const(char[])[] symbolTable, IonDescribedValue value) pure nothrow @safe) const`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(37,19):        Candidates are: `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(48,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @nogc @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(53,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(58,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) @safe dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(63,19):                        `mir.ion.stream.IonValueStream.opApply(scope int delegate(scope const(char[])[] symbolTable, scope IonDescribedValue value) pure @nogc @system dg)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\stream.d(321,9):        ... (19 more, -v to show) ...
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\package.d(979,32): Error: template instance `mir.ion.stream.IonValueStream.serialize!(TextSerializer!("\x09", Appender!(char[])))` error instantiating
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\text.d(717,23):        instantiated from here: `serializeValue!(TextSerializer!("\x09", Appender!(char[])), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ser\text.d(675,28):        instantiated from here: `serializeTextPretty!(Appender!(char[]), IonValueStream)`
C:\Users\Hipreme\AppData\Local\dub\packages\mir-ion-2.1.3\mir-ion\source\mir\ion\conv.d(422,31):        instantiated from here: `serializeTextPretty!("\x09", IonValueStream)`

CI rework

For each of the following repositories we need to setup GitHub CI for the following compiler versions:

  • dmd 2.098.1
  • ldc 12.0.1
  • dmd latest
  • ldc latest
  • dmd beta (allow failures)
  • ldc beta (allow failures)
  • dmd master (allow failures)
  • ldc master (allow failures)

If compilers fails, please open an issue with corresponding link to the CI job.

With matrix on:

  • linux 32 bit
  • linux 64 bit
  • windows 64 bit
  • macos (if they are free, needs to check)
  • linux 64 bit on ARM CPU (is it free, needs to check)

Please remove Windows 32 bit support if any.

Repositories to update:

serdeEnumProxy not working inside Variants

See #28 (comment)

@serdeEnumProxy!int
enum MyEnum
{
	off, on
}

struct ServerCapabilities
{
	Variant!(void, bool, MyEnum) v;
}

trying to deserialize JSON {"v":0} results in Unexpected IonTypeCode for Algebraic!(void, bool, MyEnum)

This issue does not occur with Nullable!MyEnum or Variant!(void, MyEnum) because of a special otpimization case for these simple cases (#28)

Right now this is not a high priority issue for me, but documenting it because it could lead to issues in the future and we might want to fix this eventually.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.