]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
non-nullable: Accessing array methods is safe when the array is null
authorLuca Bruno <lucabru@src.gnome.org>
Wed, 18 Jun 2014 19:43:51 +0000 (21:43 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Wed, 18 Jun 2014 19:50:44 +0000 (21:50 +0200)
Partially fixes bug 728656

vala/valamemberaccess.vala

index b0c48ee4fca80d1991b3c475bdba7e4a7b6ec9e7..26a413ca95c09f3e5509351f17559aa38b89c76e 100644 (file)
@@ -795,7 +795,8 @@ public class Vala.MemberAccess : Expression {
                        }
 
                        if (context.experimental_non_null && instance && inner.value_type.nullable &&
-                           !(inner.value_type is PointerType) && !(inner.value_type is GenericType)) {
+                           !(inner.value_type is PointerType) && !(inner.value_type is GenericType) &&
+                               !(inner.value_type is ArrayType)) {
                                Report.error (source_reference, "Access to instance member `%s' from nullable reference denied".printf (symbol_reference.get_full_name ()));
                        }