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 608904 - Coalescing assignment (??=)
Coalescing assignment (??=)
Status: RESOLVED WONTFIX
Product: vala
Classification: Core
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Vala maintainers
Vala maintainers
: 625777 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-02-03 16:45 UTC by zarevucky.jiri
Modified: 2010-08-01 20:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description zarevucky.jiri 2010-02-03 16:45:36 UTC
Since coalescing operator has been implemented, it would be nice (and logical) to also have a matching assignment operator.
Comment 1 Jürg Billeter 2010-03-26 19:56:44 UTC
I don't think it's a good idea to add conditional assignment operators. If I see an assignment, I expect the right hand side to always be evaluated. This would not be the case with ??=. The other binary conditional operators (&& and ||) don't have a matching assignment operator, either.

I also don't think that self-assignment with the coalescing operator is really that common. The left hand side of ?? is always nullable while the right hand side is often non-null. Assigning to a nullable variable would often not be the best choice, in my opinion.
Comment 2 carlo.teubner 2010-08-01 20:29:48 UTC
*** Bug 625777 has been marked as a duplicate of this bug. ***