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 526549 - Remove support for static delegates
Remove support for static delegates
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Delegates
0.3.x
Other All
: High normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-06 17:49 UTC by Jürg Billeter
Modified: 2009-04-15 07:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jürg Billeter 2008-04-06 17:49:58 UTC
We currently use the 'static' modifier for delegates without a user_data parameter. I propose to replace the modifier by a CCode attribute for the following reasons:

 * A static delegate is just a limited delegate that doesn't have any advantages. The only reason we have static delegates is to support callbacks without user_data in bindings. It's more appropriate to use CCode attributes instead of modifiers for C-specific annotations.

 * In other places, the 'static' modifier is used as a member modifier that is relative to the parent type, e.g. static fields in a class are instance-independent, however, fields in a namespace are always instance-independent and don't require the 'static' modifier. The 'static' modifiers in delegate declarations don't follow the same rules.
Comment 1 Jürg Billeter 2008-05-25 21:31:56 UTC
Increase priority as it's an incompatible change.
Comment 2 sam 2008-08-14 19:15:25 UTC
This may be way out, but when I declare a delegate within a class definition I expect it to have a user data which has the type of the class.

If it has the static modifier, or is declared outside of a class then I expect it not to have such a user data parameter.

It makes sense to me, but I don't understand how this relates to the bug report.

Sam
Comment 3 Jürg Billeter 2008-08-14 19:32:21 UTC
That's not how it's supposed to work. Delegates are usually not specific to a specific class, that is, you can use any object as user_data, and you often want to have user_data without putting the delegate into a class.
Comment 4 Jürg Billeter 2009-04-14 16:38:11 UTC
commit 3b5e848ec6ec8c0b454a144113de356394a0a89c
Author: Jürg Billeter <j@bitron.ch>
Date:   Tue Apr 14 18:36:36 2009 +0200

    Update bindings to not use static modifier for delegates
Comment 5 Jürg Billeter 2009-04-15 07:49:18 UTC
commit 1505848107f297e58e3c650777c4475f90a149b9
Author: Jürg Billeter <j@bitron.ch>
Date:   Tue Apr 14 18:33:44 2009 +0200

    Replace static modifier for delegates by attribute
    
    Replace `static' modifier for delegates without a user_data parameter
    by [CCode (has_target = false)] as we only support this for bindings,
    it is not considered a language feature. Fixes bug 526549.