GNOME Bugzilla – Bug 710085
IOError.from_errno is unusable
Last modified: 2016-09-18 12:43:46 UTC
Trying to use IOError.from_errno results in a C error: int main (string[] args) { throw IOError.from_errno (Posix.errno); } Output: ioerror.vala:2.5-2.43: warning: unhandled error `GLib.IOError' throw IOError.from_errno (Posix.errno); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /home/jens/Source/rygel/ioerror.vala.c: In function ‘_vala_main’: /home/jens/Source/rygel/ioerror.vala.c:30:9: error: incompatible types when assigning to type ‘struct GError *’ from type ‘GIOErrorEnum’ /home/jens/Source/rygel/ioerror.vala.c: In function ‘main’: /home/jens/Source/rygel/ioerror.vala.c:41:2: warning: ‘g_type_init’ is deprecated (declared at /opt/rygel-stable/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations] error: cc exited with status 256 Compilation failed: 1 error(s), 1 warning(s)
Right, from_errno needs a wrapper or such to convert IOErrorEnum to an IOError.
*** This bug has been marked as a duplicate of bug 664530 ***