GNOME Bugzilla – Bug 434929
length inference for returned value arrays
Last modified: 2008-11-12 20:47:55 UTC
It would be great if methods could return arrays of value structs, hence avoiding this "error: arrays of value-type structs with no explicit length parameter are not supported"... As far as I can tell there is no way to specify an explicit length parameter here, since it seems from looking at the compiler sources that returned arrays are not considered. I ran into this trying to bind to the function g_type_children().
Just to clarify: The limitation boils down to the inability to bind C functions that return an array of value types. This bug is what is really holding me back from using Vala, since I cannot bind to many libgsf functions that return uchar[].
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report. Vala assumes now that methods returning arrays return the array length via the last function argument. Methods not supporting this have to be annotated with the [NoArrayLength] attribute.
Test case added in vala-tests, for the g_type_children() and string.split () calls.