GNOME Bugzilla – Bug 672612
allow-none attribute for properties
Last modified: 2015-02-07 16:49:21 UTC
I was wondering if it makes sense for gobject-introspection to have allow-none annotations for properties. I personally ran into the problem while using GIR with vala that properties cannot be annotated with allow-none. Vala allows for specifying whether or not a return value (also of a property) can be null (using ? after the type). This means that currently creating a GIR from some vala classes and then trying to use that GIR again in vala will fail in unexpected ways. A particular example of this is when trying to implement an interface which was exported in the GIR.
Ping?
Basically (allow-none) is a subset of vala's nullable types. See also bug 626395 I am against just adding more (allow-none) to mean (nullable) without having a full plan for what it means in all of the cases. In particular how it interacts with (out) and (inout), and how we would handle the fact that the default assumption for return values is that they may be null, so we'd actually want (not-null) or something.
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 660879 ***
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]