From: Jürg Billeter Date: Fri, 8 May 2009 12:19:57 +0000 (+0200) Subject: Support enum values as array indices X-Git-Tag: 0.7.3~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcd867956453fe75236fe3c081e2e81e51376967;p=thirdparty%2Fvala.git Support enum values as array indices --- diff --git a/vala/valaarraycreationexpression.vala b/vala/valaarraycreationexpression.vala index 8b8049c4f..6181b0f67 100644 --- a/vala/valaarraycreationexpression.vala +++ b/vala/valaarraycreationexpression.vala @@ -193,7 +193,7 @@ public class Vala.ArrayCreationExpression : Expression { if (e.value_type == null) { /* return on previous error */ return false; - } else if (!(e.value_type is IntegerType)) { + } else if (!(e.value_type is IntegerType || e.value_type is EnumValueType)) { error = true; Report.error (e.source_reference, "Expression of integer type expected"); } diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala index 2097efa18..c22131f7d 100644 --- a/vala/valaelementaccess.vala +++ b/vala/valaelementaccess.vala @@ -187,7 +187,7 @@ public class Vala.ElementAccess : Expression { } /* check if the index is of type integer */ - if (!(e.value_type is IntegerType)) { + if (!(e.value_type is IntegerType || e.value_type is EnumValueType)) { error = true; Report.error (e.source_reference, "Expression of integer type expected"); }