Re: [Vala] interface properties: unexistent accessor



On 17.11.2008 13:08:20, Alexander Bokovoy wrote:
On Sun, Nov 16, 2008 at 8:17 PM, Alexander Bokovoy <ab altlinux org> wrote:
> 2008/11/16 Ildar Mulyukov <ildar users sourceforge net>:
>> valac test-iface-prop-noset-impl.vala
>> test-iface-prop-noset-iface.vala/tmp/.private/ildar/ccIVSzoO.o: In function
>> `ns1_class1_set_property':
>> test-iface-prop-noset-impl.c:(.text+0x482): undefined reference to
>> `ns1_interface1_set_name'
>>
I discovered the problem (and created this simple test case). The root of it is that the unexistent accessor referenced from the implementor class. Maybe it's better not to do it?
Which vala build is it? (I've just pushed r2023 with a lot of fixes to Sisyphus).
Discussed with Ildar. Apparently, main problem is that he has interface definition and a class that implements interface in separate vala source files. During generation phase valac puts ns1_interface1_set_name() into one .c file and marks it as static. Therefore it is not accessible from the second .c file where ns1_class1_set_property() is defined.

In such cases _set_property() functions generated by gobject/valaobjectmodule.vala:add_set_property_function() need to have indirected calls via ns1_class_real_set_name(), not ns1_interface1_set_name() function.

Experimental patch attached.

Your speed is awesome!
But are you sure it would work when an interface would be in a library and the class will link to this library? I'm not sure about this.

Regards,
--
Ildar  Mulyukov,  free SW designer/programmer
================================================
email: ildar users sourceforge net
home: http://tuganger.narod.ru/
ALT Linux Sisyphus
================================================



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