[Vala] delegates with exceptions



Hi folks,

I noticed that there is support for delegates to throw when wrapping
libraries (the vapi's do it in a few places).  However, I'd like to
have a delegate in my vala code that can throw an error.  This doesn't
seem to happen even though it compiles.

For example:
    public delegate void Callback (Result result, void* data) throws GLib.Error;

currently compiles to,
    typedef void (*Callback) (Result result, void* data, void* user_data);

While I'd expect it to compile to
    typedef void (*Callback) (Result result, void* data, void*
user_data, GError **error);

Therefore, calling the method in a try/catch results in "warning:
unreachable catch clause detected".

If this really is a bug, and not just me, I'd be glad to submit a bug
report and perhaps start patching.

Cheers!

-- Christian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]