Re: [Vala] Inheriting from GLib.Action



On 06/03/2014 06:08, Edward Hennessy wrote:

Thank you for the help. I'm suspicious of the following code snippet in valagirparser.vala starting at line 
920:

prop.set_attribute ("NoAccessorMethod", false);
if (prop.get_accessor != null) {
        var m = getter != null ? getter.symbol as Method : null;
        // ensure getter vfunc if the property is abstract
        if (m != null && (m.is_abstract || m.is_virtual || !prop.is_abstract)) {
                getter.process (parser);
                if (m.return_type is VoidType || m.get_parameters().size != 0) {
                        prop.set_attribute ("NoAccessorMethod", true);
                } else {
                        if (getter.name == name) {
                                foreach (var node in colliding) {
                                        if (node.symbol is Method) {
                                                node.merged = true;
                                        }
                                }
                        }
                        prop.get_accessor.value_type.value_owned = m.return_type.value_owned;
                }
        } else {
                prop.set_attribute ("NoAccessorMethod", true);
        }
}

In the if (getter.name == name), it compares a method name to a property name. In my test case, I get ("get_enabled" == 
"enabled"). I added test code and set getter.merged to true, and the vapi output looks correct - the getter method is 
removed. Is this the code that is supposed to remove the getters from the vapi? If so, the logic does not seem correct to me.
Right above that code, there's other code checking for "get_" symbols.


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