]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Allow access to length of constant array in constant initializer lists
authorJürg Billeter <j@bitron.ch>
Tue, 5 Apr 2011 17:28:31 +0000 (19:28 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 29 May 2011 08:31:45 +0000 (10:31 +0200)
Fixes bug 643010.

vala/valamemberaccess.vala

index dfb0eb6eeb31f9584849e2cd7ee65904c798f594..7f4b6dff08740fcbd935feef090e64d61d80ad70 100644 (file)
@@ -169,6 +169,9 @@ public class Vala.MemberAccess : Expression {
                var method = symbol_reference as Method;
                if (symbol_reference is Constant) {
                        return true;
+               } else if (symbol_reference is ArrayLengthField && inner != null && inner.symbol_reference is Constant) {
+                       // length of constant array
+                       return true;
                } else if (method != null &&
                           (method.binding == MemberBinding.STATIC || prototype_access)) {
                        return true;