GNOME Bugzilla – Bug 605627
Unability to read length of a property of array type
Last modified: 2010-01-08 20:37:31 UTC
Testcase: //----------------- namespace Test { public class Obj { public int[] prop {get; private set;} public int[] variable; public Obj(int i) { prop = new int[i]; } } } void main() { Test.Obj ob = new Test.Obj(5); int len = ob.prop.length; } //----------------- Fragment of generated C code: function _main(): //----------------- void _main (void) { TestObj* ob; gint _tmp0_; gint len; ob = test_obj_new (5); len = _tmp0_; _test_obj_unref0 (ob); } //----------------- Clearly you can see, that variable len is assigned with uninitialized helper variable, and it should be assigned with length of array accessible by property getter. This bug may be related to #600564. This bug has the same workaround as #600564: var prop_length = ob.prop; int len = prop_length.length;
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 585847 ***