GNOME Bugzilla – Bug 693455
Allow to specify the order of methods in class
Last modified: 2013-07-25 07:14:46 UTC
Vala while generating interfaces (and classes?) puts the properties calls at the end. This causes problem as it prevents from adding virtual, non-abstract method to interfaces without breaking ABI.
Created attachment 242005 [details] [review] 0001-Add-Since-attribute-for-interfaces.patch Add Since attribute and code to sort the elements in interface accordingly.
I like the idea, but I'd rather see it implemented with a [Version] attribute (see bug #678912).
After discussion with Evan on IRC - bumping the importance as it is blocker for libgee development with explanation: The interfaces have properties and signals virtuals after the methods so adding any method breaks the ABI. Of course the patch can be trivially modified to name the property Version.
What happens if you reorder the methods that have the same Since version?
In the patch - they are reordered in order they are declared. For default version it is needed as otherwise the methods would be reordered after applying the patch thus globally breaking the ABI. I didn't thought changing it for methods with attribute is warranted.
Created attachment 243865 [details] [review] 0001-Add-CCode-ordering-attribute-for-interfaces.patch I've decided to go for stricter approach then one discussed with Luca: - No gaps are allowed - If ordering is specified all virtuals need to have it specified.
(In reply to comment #6) > Created an attachment (id=243865) [details] [review] > 0001-Add-CCode-ordering-attribute-for-interfaces.patch > Ping. May I ask for review (should go in/needs work)?
Review of attachment 243865 [details] [review]: Looks fine, let's do it.
Comment on attachment 243865 [details] [review] 0001-Add-CCode-ordering-attribute-for-interfaces.patch commit 2886366e6b5499b46e04029b9a257ae9dc880766 Author: Maciej Piechotka <uzytkownik2@gmail.com> Date: Sat May 11 21:43:30 2013 +0100 Add CCode ordering attribute for interfaces