Skip to content
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

Orange does not like Tuples #38

Open
Infiltrator opened this issue Jan 26, 2015 · 2 comments
Open

Orange does not like Tuples #38

Infiltrator opened this issue Jan 26, 2015 · 2 comments

Comments

@Infiltrator
Copy link

The following code fails with no property '_expand_field_0' for tuple '(const(Class))':

import std.typecons;
import orange.serialization._;
import orange.serialization.archives._;

class Class { }

alias Tuple!(Class) Tup;

class Container { Tup[] tuples; }

void save(Container container) {
   auto archive = new XmlArchive!(char);
   auto serialiser = new Serializer(archive);
   serialiser.serialize(container);
}

src/orange/orange/serialization/Serializer.d-mixin-1512:1512: error: no property '_expand_field_0' for tuple '(const(Class))' src/orange/orange/serialization/Serializer.d:825: error: template instance orange.serialization.Serializer.Serializer.objectStructSerializeHelper!(const(Tuple!(Class))) error instantiating src/orange/orange/serialization/Serializer.d:721: note: instantiated from here: serializeStruct!(const(Tuple!(Class))) src/orange/orange/serialization/Serializer.d:850: note: instantiated from here: serializeInternal!(const(Tuple!(Class))) src/orange/orange/serialization/Serializer.d:727: note: instantiated from here: serializeArray!(Tuple!(Class)[]) src/orange/orange/serialization/Serializer.d:924: note: ... (4 instantiations, -v to show) ... src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Container) src/saving.d:14: note: instantiated from here: serialize!(Container) src/orange/orange/serialization/Serializer.d:721: error: template instance orange.serialization.Serializer.Serializer.serializeStruct!(const(Tuple!(Class))) error instantiating src/orange/orange/serialization/Serializer.d:850: note: instantiated from here: serializeInternal!(const(Tuple!(Class))) src/orange/orange/serialization/Serializer.d:727: note: instantiated from here: serializeArray!(Tuple!(Class)[]) src/orange/orange/serialization/Serializer.d:924: note: instantiated from here: serializeInternal!(Tuple!(Class)[]) src/orange/orange/serialization/Serializer.d:1541: note: ... (3 instantiations, -v to show) ... src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Container) src/saving.d:14: note: instantiated from here: serialize!(Container) src/orange/orange/serialization/Serializer.d:850: error: template instance orange.serialization.Serializer.Serializer.serializeInternal!(const(Tuple!(Class))) error instantiating src/orange/orange/serialization/Serializer.d:727: note: instantiated from here: serializeArray!(Tuple!(Class)[]) src/orange/orange/serialization/Serializer.d:924: note: instantiated from here: serializeInternal!(Tuple!(Class)[]) src/orange/orange/serialization/Serializer.d:1541: note: instantiated from here: serializePointer!(Tuple!(Class)[]*) src/orange/orange/serialization/Serializer.d:798: note: ... (2 instantiations, -v to show) ... src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Container) src/saving.d:14: note: instantiated from here: serialize!(Container) src/orange/orange/serialization/Serializer.d:727: error: template instance orange.serialization.Serializer.Serializer.serializeArray!(Tuple!(Class)[]) error instantiating src/orange/orange/serialization/Serializer.d:924: note: instantiated from here: serializeInternal!(Tuple!(Class)[]) src/orange/orange/serialization/Serializer.d:1541: note: instantiated from here: serializePointer!(Tuple!(Class)[]*) src/orange/orange/serialization/Serializer.d:798: note: instantiated from here: objectStructSerializeHelper!(Container) src/orange/orange/serialization/Serializer.d:718: note: ... (1 instantiations, -v to show) ... src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Container) src/saving.d:14: note: instantiated from here: serialize!(Container) src/orange/orange/serialization/Serializer.d:924: error: template instance orange.serialization.Serializer.Serializer.serializeInternal!(Tuple!(Class)[]) error instantiating src/orange/orange/serialization/Serializer.d:1541: note: instantiated from here: serializePointer!(Tuple!(Class)[]*) src/orange/orange/serialization/Serializer.d:798: note: instantiated from here: objectStructSerializeHelper!(Container) src/orange/orange/serialization/Serializer.d:718: note: instantiated from here: serializeObject!(Container) src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Container) src/saving.d:14: note: instantiated from here: serialize!(Container) src/orange/orange/serialization/Serializer.d:1541: error: template instance orange.serialization.Serializer.Serializer.serializePointer!(Tuple!(Class)[]*) error instantiating src/orange/orange/serialization/Serializer.d:798: note: instantiated from here: objectStructSerializeHelper!(Container) src/orange/orange/serialization/Serializer.d:718: note: instantiated from here: serializeObject!(Container) src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Container) src/saving.d:14: note: instantiated from here: serialize!(Container) src/orange/orange/serialization/Serializer.d:798: error: template instance orange.serialization.Serializer.Serializer.objectStructSerializeHelper!(Container) error instantiating src/orange/orange/serialization/Serializer.d:718: note: instantiated from here: serializeObject!(Container) src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Container) src/saving.d:14: note: instantiated from here: serialize!(Container) src/orange/orange/serialization/Serializer.d:718: error: template instance orange.serialization.Serializer.Serializer.serializeObject!(Container) error instantiating src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Container) src/saving.d:14: note: instantiated from here: serialize!(Container) src/orange/orange/serialization/Serializer.d:665: error: template instance orange.serialization.Serializer.Serializer.serializeInternal!(Container) error instantiating src/saving.d:14: note: instantiated from here: serialize!(Container) src/saving.d:14: error: template instance orange.serialization.Serializer.Serializer.serialize!(Container) error instantiating

@jacob-carlborg
Copy link
Owner

I'll see what I can do.

@Infiltrator
Copy link
Author

It works (or rather doesn't) with alias Tuple!(int) Tup;, so it's not a class thing.

And also without the container:

import std.typecons;
import orange.serialization._;
import orange.serialization.archives._;

alias Tuple!(int) Tup;

void save() {
   auto archive = new XmlArchive!(char);
   auto serialiser = new Serializer(archive);
   auto tup = Tup(2);
   serialiser.serialize(tup);
}

With a shorter error message list:

src/orange/orange/serialization/Serializer.d-mixin-1512:1512: error: no property '_expand_field_0' for tuple '(int)'
src/orange/orange/serialization/Serializer.d:825: error: template instance orange.serialization.Serializer.Serializer.objectStructSerializeHelper!(Tuple!int) error instantiating
src/orange/orange/serialization/Serializer.d:721: note: instantiated from here: serializeStruct!(Tuple!int)
src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Tuple!int)
src/saving.d:11: note: instantiated from here: serialize!(Tuple!int)
src/orange/orange/serialization/Serializer.d:721: error: template instance orange.serialization.Serializer.Serializer.serializeStruct!(Tuple!int) error instantiating
src/orange/orange/serialization/Serializer.d:665: note: instantiated from here: serializeInternal!(Tuple!int)
src/saving.d:11: note: instantiated from here: serialize!(Tuple!int)
src/orange/orange/serialization/Serializer.d:665: error: template instance orange.serialization.Serializer.Serializer.serializeInternal!(Tuple!int) error instantiating
src/saving.d:11: note: instantiated from here: serialize!(Tuple!int)
src/saving.d:11: error: template instance orange.serialization.Serializer.Serializer.serialize!(Tuple!int) error instantiating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants