I guess I am not surprised that something as complex as the entire demo doesn't serialize correct - I've never tried that. But I will take a look when I get a chance. Thanks.
qualidafialTue 14 Apr 2009
I think this is a bug in Field.java:
// check generic type (the Java runtime will check non-generics)
if (of.isGenericInstance() && value != null)
{
if (!of.is(type(value)))
throw ArgErr.make("Wrong type for field " + qname() + ": " + of + " != " + type(value)).val;
}
The code is checking whether the destination field's type fits the new value's type, but it should be checking the other way around.
// check generic type (the Java runtime will check non-generics)
if (of.isGenericInstance() && value != null)
{
if (!type(value).is(of))
throw ArgErr.make("Wrong type for field " + qname() + ": " + of + " != " + type(value)).val;
}
The C# sources need to be fixed likewise.
brianWed 15 Apr 2009
Promoted to ticket #518 and assigned to brian
brianWed 15 Apr 2009
Renamed from Problem in examples\fan\demo.fan to Problem in check of reflective field set
brianWed 15 Apr 2009
Thanks for tracking that problem down. Seems we were missing a test for that case. I pushed the fix and added a test.
qualidafial Fri 10 Apr 2009
brian Sat 11 Apr 2009
I guess I am not surprised that something as complex as the entire demo doesn't serialize correct - I've never tried that. But I will take a look when I get a chance. Thanks.
qualidafial Tue 14 Apr 2009
I think this is a bug in Field.java:
The code is checking whether the destination field's type fits the new value's type, but it should be checking the other way around.
The C# sources need to be fixed likewise.
brian Wed 15 Apr 2009
Promoted to ticket #518 and assigned to brian
brian Wed 15 Apr 2009
Renamed from Problem in examples\fan\demo.fan to Problem in check of reflective field set
brian Wed 15 Apr 2009
Thanks for tracking that problem down. Seems we were missing a test for that case. I pushed the fix and added a test.
Ticket resolved in 1.0.42
qualidafial Wed 15 Apr 2009
Verified against tip, thanks for the fix.