gi-crystal icon indicating copy to clipboard operation
gi-crystal copied to clipboard

Function prototypes cannot return nil, even if stated in the docs

Open BlobCodes opened this issue 3 years ago • 2 comments

Taking a look at the definition of Gtk::TreeListModelCreateModelFunc:

This function can return %NULL to indicate that @item is guaranteed to be a leaf node and will never have children

However, it is defined as GObject::Object -> Gio::ListModel (we cannot return nil)

BlobCodes avatar Jun 25 '22 10:06 BlobCodes

I guess we need need to assume that whatever pointer in callbacks are nullable, due to the lack of GIR annotations for that.

hugopl avatar Jun 25 '22 23:06 hugopl

I guess we need need to assume that whatever pointer in callbacks are nullable, due to the lack of GIR annotations for that.

I just checked if there's really no annotation for that.. but there actually is one! PR is #49

BlobCodes avatar Jun 26 '22 00:06 BlobCodes