GNOME Bugzilla – Bug 619545
gobject-introspection can't express non-primitive-array containers' element types
Last modified: 2015-02-07 16:53:08 UTC
This annotated GLib/C code fragment: /** * Returns: (element-type GLib.Value) the value */ GPtrArray * get_values (Foo *src) {} ends up with this .gir fragment for its return type: <array name="GLib.PtrArray" c:type="GPtrArray*"> <type name="GLib.Value"/> </array> which maps to the C type "GValue*[]" (and Vala type "GLib.Value[]"). However, the real return type is "GLib.PtrArray of GLib.Value elements" (Vala type GLib.PtrArray<GLib.Value>). So my proposal is that the g-i scanner instead generate this GIR fragment from the annotated code above: <type name="GLib.PtrArray" c:type="GPtrArray*"> <type name="GLib.Value" c:type="GValue*"/> </type> For types that truly are primitive arrays, the element-type will correspond to the C type. Eg, /** * Returns: (element-type GLib.Value) the value */ GValue ** get_values_primitive_array (Foo *src) {} which should result in the GIR fragment <array name="GLib.Value" c:type="GValue*"></array>
Johan, any chance you could take a look at this? It's the end of a chain of a few bugs blocking a release of libfolks, which is proposed as a new external dependency for Empathy for Gnome 3.0.0.
Created attachment 162068 [details] [review] [scanner] Element-type annotation for GArray types Add support for (element-type) annotations for G*Array types.
Attachment 162068 [details] pushed as e77f99f - [scanner] Element-type annotation for GArray types
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]