GNOME Bugzilla – Bug 670430
g_io_error_from_errno / IOError.from_errno is bound wrong
Last modified: 2012-02-20 10:33:28 UTC
The bindings are marked to return a IOError. The original function returns just an entry from the GIOError enum, so Vala generates code that tries to assign an enum to a GError which of course fails: int main() { var f = IOError.from_errno (-12); return 0; } gint _vala_main (void) { gint result = 0; GError* _tmp0_ = NULL; GError* _tmp1_; GError* f; _tmp0_ = g_io_error_from_errno (-12); _tmp1_ = _g_error_copy0 (_tmp0_); f = _tmp1_; result = 0; _g_error_free0 (f); return result; }
Also it looks like the code is leaking a GError (_tmp0_)
(In reply to comment #1) > Also it looks like the code is leaking a GError (_tmp0_) My bad, the binding says "unowned IOError", so that would be correct.
*** This bug has been marked as a duplicate of bug 664530 ***