After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 639325 - Generated introspection broken
Generated introspection broken
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 623247
 
 
Reported: 2011-01-12 15:57 UTC by Bastien Nocera
Modified: 2011-01-14 14:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rename gtk_container_class_handle_border_width (10.14 KB, patch)
2011-01-13 16:04 UTC, Colin Walters
rejected Details | Review
GtkContainer: make "handle_border_width" member private (2.23 KB, patch)
2011-01-13 21:29 UTC, Colin Walters
none Details | Review

Description Bastien Nocera 2011-01-12 15:57:18 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).
Comment 1 Matthias Clasen 2011-01-12 21:32:09 UTC
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
Comment 2 Colin Walters 2011-01-13 14:53:14 UTC
(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+?
Comment 3 Colin Walters 2011-01-13 16:04:30 UTC
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.
Comment 4 Matthias Clasen 2011-01-13 21:11:06 UTC
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.
Comment 5 Colin Walters 2011-01-13 21:29:29 UTC
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
Comment 6 Bastien Nocera 2011-01-14 01:18:24 UTC
That'd work for me.
Comment 7 Matthias Clasen 2011-01-14 14:29:52 UTC
Thanks, committed