GNOME Bugzilla – Bug 548895
wrong property-accessors code
Last modified: 2008-09-26 20:34:18 UTC
Please describe the problem: I hit followiing bug when i tried to compile valadoc with trunk: ----------------------------------------------- using GLib; public interface Blaetterkleid : Object { public abstract bool is_public { get; } } public class Wurzel : Object { public bool is_public { get { return true; } } } public class Stamm : Wurzel, Blaetterkleid { } public class Apfel : Stamm { public static int main ( string[] args ) { return 0; } } ----------------------------------------------- static void stamm_blaetterkleid_interface_init (BlaetterkleidIface * iface) { stamm_blaetterkleid_parent_iface = g_type_interface_peek_parent (iface); iface->get_is_public = stamm_real_get_is_public; } ----------------------------------------------- mog@mogulus:~/Desktop$ valac -o food test.vala test.c: In Funktion »stamm_blaetterkleid_interface_init«: test.c:111: Fehler: »stamm_real_get_is_public« nicht deklariert (erste Benutzung in dieser Funktion) test.c:111: Fehler: (Jeder nicht deklarierte Bezeichner wird nur einmal aufgeführt test.c:111: Fehler: für jede Funktion in der er auftritt.) error: cc exited with status 256 Compilation failed: 1 error(s), 0 warning(s) Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 117383 [details] [review] - The patch should work fine but there are still c-compiler warning for each setter and getter in interfaces. The problem is thedefined function pointer in the interface struct whih doesn't met the generated access-funtions from the classes. ValaSourceFile* (*get_get_obj) (Blaetterkleid* self); void (*set_get_obj) (Blaetterkleid* self, ValaSourceFile* value);
*** Bug 553569 has been marked as a duplicate of this bug. ***
Thanks for the patch. The logic is not quite correct in the virtual/override case. I'll fix this and commit.
2008-09-26 Jürg Billeter <j@bitron.ch> * gobject/valaccodeclassbinding.vala: Use correct accessor cname for interface implementations of properties inherited from a base class, based on patch by Florian Brosch, fixes bug 548895 Fixed in r1787.