GNOME Bugzilla – Bug 639325
Generated introspection broken
Last modified: 2011-01-14 14:29:52 UTC
When trying to compile a Vala plugin that uses the Gtk-3.0.gir file in https://bugzilla.gnome.org/show_bug.cgi?id=623247#c3: Gtk-3.0.gir:19093.7-19093.6: error: `ContainerClass' already contains a definition for `handle_border_width' </method> Gtk-3.0.gir:18849.7-18849.6: note: previous definition of `handle_border_width' was here </field> You can indeed see the redefinition (one is a property, the other a class function to override).
this is somewhat bizarre, because there isn't actually a handle_border_width vfunc, just a gtk_container_class_handle_border_width() function. I guess something helpfully OO-izes that to a handle_border_width method in the GtkContainer class
(In reply to comment #1) > I guess something helpfully OO-izes that to a handle_border_width method in the > GtkContainer class Yes. While at present the scanner doesn't reject this, in practice it isn't going to work for bindings to have methods and properties with the same name. I can make this a scanner error so we find things like this earlier, but can we change the name of one of these in GTK+?
Created attachment 178241 [details] [review] Rename gtk_container_class_handle_border_width Language bindings aren't going to handle well GtkContainerClass having a method and structure field both named "handle_border_width". Fix this by renaming the method, which also makes it clearer that the method changes/sets something.
Review of attachment 178241 [details] [review]: Not going to take api changes at this point. Lets make the flag private instead, and rename it for good measure.
Created attachment 178259 [details] [review] GtkContainer: make "handle_border_width" member private Otherwise in introspection we get a naming conflict between the structure member and the method. http://bugzilla.gnome.org/show_bug.cgi?id=639325
That'd work for me.
Thanks, committed