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 690380 - Generated equal-functions of derived structs are broken
Generated equal-functions of derived structs are broken
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-17 20:20 UTC by Rico Tzschichholz
Modified: 2013-01-18 18:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codegen: Use equal method of base-struct for derived structs (1.76 KB, patch)
2012-12-17 20:24 UTC, Rico Tzschichholz
none Details | Review
codegen: Use equal method of base-struct for derived structs (1.77 KB, patch)
2012-12-17 20:34 UTC, Rico Tzschichholz
committed Details | Review

Description Rico Tzschichholz 2012-12-17 20:20:31 UTC
The generated equal-functions of derived structs are broken.
e.g. comparing two Gdk.Rectangle in gtk+3.0 doesn't work.
Comment 1 Rico Tzschichholz 2012-12-17 20:24:49 UTC
Created attachment 231775 [details] [review]
codegen: Use equal method of base-struct for derived structs
Comment 2 Rico Tzschichholz 2012-12-17 20:34:51 UTC
Created attachment 231776 [details] [review]
codegen: Use equal method of base-struct for derived structs
Comment 3 Marc-Andre Lureau 2012-12-17 22:58:23 UTC
Review of attachment 231776 [details] [review]:

::: tests/structs/bug690380.vala
@@ +3,3 @@
+}
+
+struct Bar : Foo {

It would make sense to test the case where the derived struct also have fields that must be compared.
Comment 4 Rico Tzschichholz 2012-12-18 10:37:56 UTC
> It would make sense to test the case where the derived struct also have fields
> that must be compared.

Adding additional fields to derived structs is not possible.
Comment 5 Luca Bruno 2013-01-18 18:13:36 UTC
Review of attachment 231776 [details] [review]:

Looks safe to me.
Comment 6 Rico Tzschichholz 2013-01-18 18:25:40 UTC
Review of attachment 231776 [details] [review]:

commit a18c17e614ad5d3e8b6af31e1b986f717af30cbb
Author: Rico Tzschichholz <ricotz@t-online.de>
Date:   Mon Dec 17 21:27:27 2012 +0100

    codegen: Use equal method of base-struct for derived structs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690380