Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No bindings generated for Vala async methods #1470

Open
kawadakk opened this issue May 11, 2023 · 0 comments
Open

No bindings generated for Vala async methods #1470

kawadakk opened this issue May 11, 2023 · 0 comments

Comments

@kawadakk
Copy link
Contributor

kawadakk commented May 11, 2023

public abstract interface Foo.Bar : Object {
    public virtual async void hoge_async(Cancellable? cancellable = null) throws Error {}
}

Vala produces the following GIR for this method:

<virtual-method name="hoge_async" invoker="hoge_async">
  <return-value transfer-ownership="none">
    <type name="none" c:type="void"/>
  </return-value>
  <parameters>
    <instance-parameter name="self" transfer-ownership="none">
      <type name="Foo.Bar" c:type="FooBar*"/>
    </instance-parameter>
    <parameter name="cancellable" transfer-ownership="none" nullable="1">
      <type name="Gio.Cancellable" c:type="GCancellable*"/>
    </parameter>
    <parameter name="_callback_" transfer-ownership="none" nullable="1" closure="2" scope="async">
      <type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/>
    </parameter>
    <parameter name="_callback__target" transfer-ownership="none" nullable="1">
      <type name="gpointer" c:type="void*"/>
    </parameter>
  </parameters>
</virtual-method>

GIR does not seem to recognize the callback parameter, resulting in a missing binding:

if r#async && (par.name == "callback" || par.name.ends_with("_callback")) {

    //#[doc(alias = "foo_bar_hoge_async")]
    //fn hoge_async(&self, cancellable: Option<&impl IsA<gio::Cancellable>>, _callback_: AsyncReadyCallback) {
    //    unsafe { TODO: call ffi:foo_bar_hoge_async() }
    //}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant