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 780522 - Ownership transfer of implicit GLib.Value/Variant transformation in property-getters is not recognized
Ownership transfer of implicit GLib.Value/Variant transformation in property-...
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator: GObject
0.36.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-25 07:16 UTC by Yannick Inizan
Modified: 2018-05-22 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (337 bytes, text/x-vala)
2017-03-25 07:16 UTC, Yannick Inizan
Details
test case 2 (423 bytes, text/x-vala)
2017-03-25 07:47 UTC, Yannick Inizan
Details

Description Yannick Inizan 2017-03-25 07:16:13 UTC
Created attachment 348689 [details]
test case

with GLib.Value as GObject property, Vala generates two GValue and returns wrong value (the initialized GValue isn't returned)
Comment 1 Yannick Inizan 2017-03-25 07:20:11 UTC
vala version : 0.34.7
GLib version 2.52.0
Comment 2 Yannick Inizan 2017-03-25 07:42:06 UTC
same bug with vala = 0.36.0, where value is unset before being returned.
Comment 3 Yannick Inizan 2017-03-25 07:47:14 UTC
Created attachment 348691 [details]
test case 2

In this test case, the value in static function isn't unset
Comment 4 Rico Tzschichholz 2017-03-25 07:58:27 UTC
The problem is that due to the implicit GValue conversion the property-accessor must be declared as "owned get".
Property-accessors are by default unowned, so vala needs to throw an error about owned to unowned assignment.
Comment 5 Yannick Inizan 2017-03-25 07:59:58 UTC
I understand. so I have to rewrite my code. thanks :)
Comment 6 Rico Tzschichholz 2017-03-25 14:43:40 UTC
This is a bug after all.

Marking the property-getter as "owned get { ... }" is hardly a rewrite ;)
Comment 7 GNOME Infrastructure Team 2018-05-22 15:47:40 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/581.