GNOME Bugzilla – Bug 777345
Support null-conditional operators
Last modified: 2017-01-17 00:54:59 UTC
Created attachment 343576 [details] add support for null-conditional operators C# 6.0 supports null-conditional operators "?." and "?[", and developers can handle assigning value to local variable (for thread safety), null-check and method invocation (or member access) with them easily. obj?.call_method (); Preceding expression can be translated into the following lines. var local = obj; if (local != null) { local.call_method (); } For more description, please see here. (https://msdn.microsoft.com/en-us/library/dn986595.aspx) Attached patch includes implementations of null-conditional operators on vala.
Please attach your proposal to this existing bug report for this matter. https://bugzilla.gnome.org/show_bug.cgi?id=761267
*** This bug has been marked as a duplicate of bug 761267 ***
In parallel to this there should be a bunch of test-cases added.
Comment on attachment 343576 [details] add support for null-conditional operators Please see bug 761267 for improved one for this.