[Vala] GMarkup broken in Vala 0.4.0?



First let congratulate the new Vala release.

I was trying to upgrade to vala 0.4.0 but I ran into troubles with
GMarkup very quickly.

The GMarkup callbacks were declared as static in 0.3.5(I hope it wasn't
modified to static by me); in 0.4.0 they become non-static.

However, these functions don't seem to be working if declared as
non-static delegates. 


With non-static delegates The following code doesn't produce compilable
ccode with 0.4 compiler.

class MyClass {
MarkupParser p;

    void somefunction() {
        p.start_element = start_element; 
    }
    void start_element(MarkupParseContext context, string element_name, 
          string[] attribute_names, string[] attribute_values) {
        //do stuff
    }
}

The generated also code tries to set a fictional p.start_element_target
to 'self'. GCC panics that 'self' is lost thereafter.

The following workaround also fails in 0.4.0 vala; it worked in 0.3.5
with the static GMarkup funcs.
class MyClass {
MarkupParser p;

    void somefunction() {
        p.start_element = start_element; 
    }
    static void start_element(MarkupParseContext context, string element_name, 
          string[] attribute_names, string[] attribute_values, void* user_data) {
        //do stuff
    }
}
This time vala complains it can not convert the types. I thought some
time ago vala was able to know the difference between a static member
func and a non-static delegate.


I'll come up with a bug report later tomorrow if it is possible and
needed.

Yu




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