Async generated code is dropping a parameter
Generated code can sometimes drop a parameter specified in the vala source. I hit this when using libsecret, but am not sure if it's related to that library's bindings or not.
To reproduce:
- Download the
test.vala
file attached to this issue. - Compile it like so:
valac --pkg gio-2.0 --pkg libsecret-1 -C test.vala
- Run
grep password_lookup test.c
Current output (with valac 0.48.5 on Ubuntu 20.04 and libsecret 0.20.2):
_data_->_tmp2_ = secret_password_lookup_sync (_data_->_tmp1_, NULL, &_data_->_inner_error0_, "key", "val", NULL);
secret_password_lookup (_data_->_tmp4_, NULL, lookup_ready, _data_, "val", NULL);
You'll notice that the "key" parameter got dropped in the async code.
The libsecret bindings I have at time of writing are, in case they are partly to blame:
[CCode (cheader_filename = "libsecret/secret.h")]
public static async string password_lookup (Secret.Schema schema, GLib.Cancellable? cancellable, ...) throws GLib.Error;
[CCode (cheader_filename = "libsecret/secret.h")]
public static string password_lookup_sync (Secret.Schema schema, GLib.Cancellable? cancellable = null, ...) throws GLib.Error;