GNOME Bugzilla – Bug 710103
Async call GLib.IOStream.splice_async failed!
Last modified: 2017-03-06 14:20:18 UTC
Hello, vala codes: public static int main (string args[]) { GLib.IOStream? is0 = null; GLib.IOStream? is1 = null; is0.splice_async.begin (is1, GLib.IOStreamSpliceFlags.NONE, GLib.Priority.DEFAULT, null, (obj, res) => { try { is0.splice_async.end (res); } catch (GLib.Error e) { } }); return 0; } compile errors: $ valac -X -w -o test test.vala --pkg gio-2.0 /home/heiher/work/test.vala.c: In function ‘__lambda2_’: /home/heiher/work/test.vala.c:51:3: error: too many arguments to function ‘g_io_stream_splice_finish’ g_io_stream_splice_finish (_data1_->is0, _tmp0_, &_inner_error_); ^ In file included from /usr/include/glib-2.0/gio/gfileiostream.h:30:0, from /usr/include/glib-2.0/gio/gio.h:71, from /home/heiher/work/test.vala.c:9: /usr/include/glib-2.0/gio/giostream.h:104:16: note: declared here gboolean g_io_stream_splice_finish (GAsyncResult *result, ^ error: cc exited with status 256 Compilation failed: 1 error(s), 0 warning(s) Thx!
g_io_stream_splice_finish does not have the instance parameter. There's a fix coming soon for finish functions that don't have an instance parameter.
*** Bug 670029 has been marked as a duplicate of this bug. ***
Created attachment 269065 [details] [review] part 1
Created attachment 269066 [details] [review] part 2
Created attachment 269067 [details] [review] part 3
Created attachment 269068 [details] [review] part 4
Created attachment 269069 [details] [review] part 5
Review of attachment 269065 [details] [review]: What about the proposed changes? I can apply them but I'd like to hear whether they are safe or not. ::: codegen/valaccodeattribute.vala @@ +455,3 @@ } + public bool finish_instance { I'm not very convinced here. I'd prefer to always give preference to the CCode, like it's being done with the other properties. ::: codegen/valaccodemethodcallmodule.vala @@ +219,3 @@ } + if (expr.is_yield_expression) { This is a little cryptic. If the in_arg_map is always done, put it outside the conditions. Clear out only when the out_arg_map must not be set for the finish function.