Vala generates incorrect code when out parameters and async functions are in use
It's possible to have an async/finish pair where the async call function has an out parameter (allowing monitoring of state during an async operation). However, the gir processing code incorrectly places this into the finish function causing the parameters of both the async and finish pairs to be incorrect. That can result in something wildly incorrect for the GAsyncReadyCallback parameter.
Since the interface/class init always casts the implementation function, there are no errors at compile time preventing the incorrect code.
Here is a snippet of a GObject-based interface that is broken.
void (*populate_async) (IdeCompletionProvider *self,
IdeCompletionContext *context,
GCancellable *cancellable,
GListModel **proposals,
GAsyncReadyCallback callback,
gpointer user_data);
GListModel *(*populate_finish) (IdeCompletionProvider *self,
GAsyncResult *result,
GError **error);