From: Rico Tzschichholz Date: Thu, 15 Apr 2021 14:49:14 +0000 (+0200) Subject: vala: length-type of arrays must not be nullable X-Git-Tag: 0.50.8~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81c3a5b9a0426ca845598336ff5b8ce2c7cf8c74;p=thirdparty%2Fvala.git vala: length-type of arrays must not be nullable --- diff --git a/vala/valaarraycreationexpression.vala b/vala/valaarraycreationexpression.vala index c3a20adf9..2ee80b4d5 100644 --- a/vala/valaarraycreationexpression.vala +++ b/vala/valaarraycreationexpression.vala @@ -258,7 +258,7 @@ public class Vala.ArrayCreationExpression : Expression { length_type = context.analyzer.int_type.copy (); } else { length_type.check (context); - if (!(length_type is IntegerType)) { + if (!(length_type is IntegerType) || length_type.nullable) { error = true; Report.error (length_type.source_reference, "Expected integer type as length type of array"); } diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala index 8b6dcf5ef..06ba5841f 100644 --- a/vala/valaarraytype.vala +++ b/vala/valaarraytype.vala @@ -319,7 +319,7 @@ public class Vala.ArrayType : ReferenceType { length_type = context.analyzer.int_type.copy (); } else { length_type.check (context); - if (!(length_type is IntegerType)) { + if (!(length_type is IntegerType) || length_type.nullable) { error = true; Report.error (length_type.source_reference, "Expected integer type as length type of array"); return false;