[vala/0.52] vala: length-type of arrays must not be nullable (2)



commit 157539317c1cd8cf057e1df43637dad501bade0e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Apr 20 14:05:55 2021 +0200

    vala: length-type of arrays must not be nullable (2)

 vala/valaarraycreationexpression.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/vala/valaarraycreationexpression.vala b/vala/valaarraycreationexpression.vala
index 2cdd3bbf0..70fc4425a 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");
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]