From 619c1c5bbbb5ebff555daed50a5e11a199dfc3ab Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Tue, 5 Apr 2011 20:52:06 +0200 Subject: [PATCH] Allow access to length of constant array in constant initializer lists --- vala-0.12.0-allow_constant_arrays.patch | 27 +++++++++++++++++++++++++ vala.spec | 10 +++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 vala-0.12.0-allow_constant_arrays.patch diff --git a/vala-0.12.0-allow_constant_arrays.patch b/vala-0.12.0-allow_constant_arrays.patch new file mode 100644 index 0000000..953edb6 --- /dev/null +++ b/vala-0.12.0-allow_constant_arrays.patch @@ -0,0 +1,27 @@ +From 5d74330d6c660ec7bc6caa6b3c23921b93358204 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=BCrg=20Billeter?= +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 + diff --git a/vala.spec b/vala.spec index 57c09af..de8a653 100644 --- a/vala.spec +++ b/vala.spec @@ -2,7 +2,7 @@ Name: vala Version: 0.12.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A modern programming language for GNOME Group: Development/Languages @@ -17,6 +17,8 @@ Source0: http://download.gnome.org/sources/vala/0.12/vala-%{version}.tar. Source1: vala-mode.el Source2: vala-init.el Source3: emacs-vala-COPYING +# https://bugzilla.gnome.org/show_bug.cgi?id=643010 +Patch0: vala-0.12.0-allow_constant_arrays.patch BuildRequires: flex BuildRequires: bison @@ -86,7 +88,7 @@ Summary: Documentation for %{name} Group: Documentation License: LGPLv2+ -BuildArch: noarch +BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: devhelp Provides: %{name}-docs = %{version}-%{release} @@ -135,6 +137,7 @@ the emacs-%{name} package to use Vala with GNU Emacs. %prep %setup -q +%patch0 -p1 -b .allow_constant_arrays %build @@ -230,6 +233,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Apr 5 2011 Michel Salim - 0.12.0-2 +- Allow access to length of constant array in constant initializer lists + * Sun Apr 3 2011 Christopher Aillon - 0.12.0-1 - Update to 0.12.0