diff options
Diffstat (limited to 'vala/valasliceexpression.vala')
-rw-r--r-- | vala/valasliceexpression.vala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vala/valasliceexpression.vala b/vala/valasliceexpression.vala index a9502b3e8..98b009b5e 100644 --- a/vala/valasliceexpression.vala +++ b/vala/valasliceexpression.vala @@ -60,6 +60,11 @@ public class Vala.SliceExpression : Expression { } } + /** + * Null-safe access. + */ + public bool null_safe_access { get; set; } + Expression _container; Expression _start; Expression _stop; @@ -111,6 +116,11 @@ public class Vala.SliceExpression : Expression { checked = true; + if (null_safe_access) { + error = !base.check (context); + return !error; + } + if (!container.check (context)) { error = true; return false; |