vala/vala-0.12.0-allow_constant_arrays.patch

28 lines
991 B
Diff

From 5d74330d6c660ec7bc6caa6b3c23921b93358204 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrg=20Billeter?= <j@bitron.ch>
Date: Tue, 5 Apr 2011 19:28:31 +0200
Subject: [PATCH] Allow access to length of constant array in constant initializer lists
Fixes bug 643010.
---
vala/valamemberaccess.vala | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index dfb0eb6..7f4b6df 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -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;
--
1.7.4.2