Annotation for required constructor properties
This is a follow-up to a conversation that happend on the GNOME JavaScript room https://matrix.to/#/!pOGgkAueAsusiyFCTb:matrix.org/$1645355626193354lLIoZ:matrix.org?via=gnome.org&via=matrix.org&via=privacytools.io
Essentially, the goal is to avoid the following situations
import Gio from 'gi://Gio';
new Gio.FileIcon(); // ko
new Gio.FileIcon(undefined); // ko
new Gio.FileIcon({}); // ko
// **
// GLib-GIO:ERROR:../gio/gfileicon.c:124:g_file_icon_constructed: assertion failed: (icon->file != NULL)
// Bail out! GLib-GIO:ERROR:../gio/gfileicon.c:124:g_file_icon_constructed: assertion failed: (icon->file != NULL)
// Aborted (core dumped)
by annotating the properties which are mandatory in constructors so that language bindings can fail gracefully.
Both gjs and gtk-rs have expressed interest.
It may also be used for improving documentation.
Edited by Sonny Piers