[vala/0.12] Allow access to length of constant array in constant initializer lists



commit 01ea696a9b56054445a28bc830f2e22725b13606
Author: Jürg Billeter <j bitron ch>
Date:   Tue Apr 5 19:28:31 2011 +0200

    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;



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