Visual D DClosure mixin error?

Rainer Schuetze r.sagitario at gmx.de
Sat Jun 22 07:09:42 UTC 2019



On 21/06/2019 15:55, Bart wrote:
> I'm getting DClosure mixin not found when trying to go to a delegate on
> the stack.
> 
> DClosure.DClosure.d_closure_marshal!(bool delegate(gdk.Event.Event,
> gtk.Widget.Widget)).d_closure_marshal(gobject.c.types.GClosure *
> closure, gobject.c.types.GValue * return_value, unsigned int
> n_param_values, gobject.c.types.GValue * param_values, void *
> invocation_hint, void * marshal_data) Line 123    D
> 
> This is a file in GtkD.
> 
> It says it's like 123 but it's actually line 121.
> 
> Dclosure.d
>     extern(C) static void d_closure_marshal(T)(GClosure* closure,
> GValue* return_value, uint n_param_values, /*const*/ GValue*
> param_values, void* invocation_hint, void* marshal_data)
>     {
>         DGClosure!(T)* cl = cast(DGClosure!(T)*)closure;
> 
>         if ( Parameters!(T).length > n_param_values )
>             assert(false, "DClosure doesn't have enough parameters.");
> 
>         if ( closure.derivativeFlag )
>         {
>             GValue[] swapped = new GValue[n_param_values];
>             swapped[0..n_param_values-1] = param_values[1..n_param_values];
>             swapped[n_param_values-1] = param_values[0];
>             param_values = swapped.ptr;
>         }
> 
>         mixin(getCallbackCall!T()); // line 121 but stack trace says
> it's 123.
>     }
> 
> 
> Seems it can't find the line nor the mixin in file correctly.
> 
> The main mixin does not seem to have this code in it either but it has
> other code related to other mixins from gtkD so it
> 
> Do you have gtk installed or are you willing to install it? The closure
> is generated for most event handling in gtkD it seems such as simple
> button click handling. Probably any gtkD example will produce such a stack.

I just tried it, and the rather new "Enable mixin debugging" feature on
the Compiler->Debug page is what you are looking for. This will write
the expanded mixins into the given file instead of the compiler just
making up random filenames.

Unfortunately, with "Separate compile and link" the link step overwrites
the file generated during compilation, so you should switch the
compilation model to "Combined compile and link" for the gtk library.


More information about the Digitalmars-d-ide mailing list