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 656204 - Vala does not take into account order of interfaces
Vala does not take into account order of interfaces
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator: GObject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-09 10:33 UTC by Maciej (Matthew) Piechotka
Modified: 2018-05-22 14:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codegen: Add implemented interfaces with the right dependant order (2.54 KB, patch)
2011-09-10 13:58 UTC, Luca Bruno
needs-work Details | Review
0001: gee: Allow to sort lists (1.34 KB, patch)
2014-09-10 21:04 UTC, Florian Brosch
none Details | Review
0002: Fix interface registration order (1.54 KB, patch)
2014-09-10 21:06 UTC, Florian Brosch
none Details | Review
0003: Do not allow to implement the same interface multiple times (1.87 KB, patch)
2014-09-10 21:07 UTC, Florian Brosch
none Details | Review

Description Maciej (Matthew) Piechotka 2011-08-09 10:33:04 UTC
If the Iterable requires Traversable such code would fail:

internal class Gee.ReadOnlyCollection<G> : Object, Iterable<G>, Traversable<G>, Collection<G> {

As:


GLib-GObject-WARNING **: cannot add interface type `GeeIterable' to type `GeeReadOnlyCollection' which does not conform to prerequisite `GeeTraversable'
FAIL

Fixes:

1. Require correct order
2. Impose correct order internally
Comment 1 Luca Bruno 2011-09-10 13:58:38 UTC
Created attachment 196171 [details] [review]
codegen: Add implemented interfaces with the right dependant order

Fixes bug 656204.
Comment 2 Eric Gregory 2013-04-12 00:34:35 UTC
Is there some reason this patch was never applied?  I just ran into this exact same issue myself.
Comment 3 Luca Bruno 2013-04-12 07:36:42 UTC
Review of attachment 196171 [details] [review]:

The patch does not guarantee that other interfaces will be added. It needs some work in order to ONLY reorder interfaces, but NOT adding new interfaces.
Comment 4 Evgeny Bobkin 2013-11-25 19:28:31 UTC
I hit this as well :-(
Comment 5 Florian Brosch 2014-09-10 21:04:08 UTC
Created attachment 285862 [details] [review]
0001: gee: Allow to sort lists
Comment 6 Florian Brosch 2014-09-10 21:06:16 UTC
Created attachment 285863 [details] [review]
0002: Fix interface registration order
Comment 7 Florian Brosch 2014-09-10 21:07:45 UTC
Created attachment 285864 [details] [review]
0003: Do not allow to implement the same interface multiple  times
Comment 8 Maciej (Matthew) Piechotka 2014-09-10 21:09:40 UTC
interface_registrer_order_cmp will cause problems as if a and b are not related then interface_registrer_order_cmp(a, b) = interface_registrer_order_cmp(b, a) = -1. Most sort implementations may produce garbage in such cases.
Comment 9 Florian Brosch 2014-09-12 10:59:22 UTC
(In reply to comment #8)
> interface_registrer_order_cmp will cause problems as if a and b are not related
> then interface_registrer_order_cmp(a, b) = interface_registrer_order_cmp(b, a)
> = -1. Most sort implementations may produce garbage in such cases.

Good catch. This is not an issue in our case but as good citizen, we should change the comparator anyway. Going to replace the patch asap.
Comment 10 GNOME Infrastructure Team 2018-05-22 14:07:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/222.