Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/jacob-carlborg/orange into …
Browse files Browse the repository at this point in the history
…unittests_and_release
  • Loading branch information
jmcabo committed Nov 27, 2013
2 parents 3f76ff5 + 6db4d34 commit 06ff9ec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion orange/serialization/Serializer.d
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ class Serializer
{
static if (m != nonSerializedField)
{
mixin(`alias getAttributes!(T.` ~ m ~ `) attrs;`);
mixin(`alias attrs = Attributes!(m, __traits(getAttributes, T.` ~ m ~ `));`);

static if (attrs.contains!(event))
__traits(getMember, value, m)();
Expand Down
3 changes: 2 additions & 1 deletion orange/util/Use.d
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ struct Use (ARGS...)
{
assert(args[0]);

static if (NEW_ARGS.length == 1)
// Issue: https://d.puremagic.com/issues/show_bug.cgi?id=11614
static if (args.length == 1)
return args[0](dg);

else
Expand Down
15 changes: 15 additions & 0 deletions tests/NonMutable.d
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ class A
A a;
immutable int ptr = 3;

class CTFEFieldsIssue35
{
public immutable FIRST = 1;
public immutable SECOND = 1;
public bool someFlag;
}

unittest
{
archive = new XmlArchive!(char);
Expand Down Expand Up @@ -97,4 +104,12 @@ unittest
assert(a == aDeserialized);
};
};

describe("serializing object with CTFE fields") in {
it("should compile") in {
assert(__traits(compiles, {
serializer.serialize(new CTFEFieldsIssue35);
}));
};
};
}

0 comments on commit 06ff9ec

Please sign in to comment.