New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vibe-d-0.8.0 tree structure serialization still a problem #1855

Closed
tchaloupka opened this Issue Jul 18, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@tchaloupka
Contributor

tchaloupka commented Jul 18, 2017

With #1673 closed/merged there is still a problem with the tree structure safety serialization after further tuning which isn't catched by the unittests.

Try for example:

@system unittest {
	import vibe.data.json;
	static struct Bar { Bar[] foos; int i; }
	auto b = deserializeJson!Bar(`{"i":1,"foos":[{"foos":[],"i":2}]}`);
	assert(b.i == 1);
	assert(b.foos.length == 1);
	assert(b.foos[0].i == 2);
}

It fails with:

data/vibe/data/serialization.d(658,24): Error: function vibe.data.json.JsonStringSerializer!(string, false).JsonStringSerializer.readArray!(Traits!(Bar[], DefaultPolicy)).readArray(scope void delegate(ulong) @safe size_callback, scope void delegate() @safe entry_callback) is not callable using argument types (void, void delegate() @system)
data/vibe/data/serialization.d(567,108): Error: template instance vibe.data.serialization.deserializeValueImpl!(JsonStringSerializer!(string, false), DefaultPolicy).deserializeValueDeduced!(Bar[]) error instantiating
data/vibe/data/serialization.d(764,48):        instantiated from here: deserializeValue!(Bar[])
data/vibe/data/serialization.d(749,31):        instantiated from here: __lambda2!string
data/vibe/data/serialization.d(567,108):        instantiated from here: deserializeValueDeduced!(Bar)
data/vibe/data/serialization.d(299,69):        ... (2 instantiations, -v to show) ...
data/vibe/data/json.d(1436,48):        instantiated from here: deserialize!(JsonStringSerializer!(string, false), Bar, string)
data/vibe/data/serialization.d(1899,30):        instantiated from here: deserializeJson!(Bar, string)
data/vibe/data/serialization.d(749,30): Error: function vibe.data.json.JsonStringSerializer!(string, false).JsonStringSerializer.readDictionary!(Traits!(Bar, DefaultPolicy)).readDictionary (scope void delegate(string) @safe entry_callback) is not callable using argument types (void)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment