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 653909 - Properties with internal setters still marked as writeable
Properties with internal setters still marked as writeable
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator: GObject
0.13.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 768641 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-07-03 19:37 UTC by Philip Withnall
Modified: 2018-05-22 14:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2011-07-03 19:37:19 UTC
With (master, 69be997725ce6d9f3bed80bd0aae3532a4023ee2), if I declare a property:

    public Object my_property { get; internal set; }

the generated C code still marks the GObject property as writeable. This is not what I expected.

The setter C function for the property is correctly not exported outside the project, and all call sites which set the property correctly call this setter; so marking the property as read-only should be fine.
Comment 1 Tristan Brindle 2012-02-07 07:10:17 UTC
But accesses within the project might still need to set the property via GLib.Object.set("my_property", value). This could the case, for example, if you're using GBindings to link two properties.

So declaring the property as non-writable doesn't seem like the correct solution.
Comment 2 Rico Tzschichholz 2017-03-09 07:11:27 UTC
*** Bug 768641 has been marked as a duplicate of this bug. ***
Comment 3 GNOME Infrastructure Team 2018-05-22 14:05:23 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/213.