2007-04-30 Jürg Billeter <j@bitron.ch>
+ * vala/valasemanticanalyzer.vala: allow any integer type as index in an
+ element access expression, fixes bug 434506
+
+2007-04-30 Jürg Billeter <j@bitron.ch>
+
* vala/parser.y, vala/valasymbolbuilder.vala,
vala/valaattributeprocessor.vala, vala/valasemanticanalyzer.vala,
vala/valacodegenerator.vala, vala/valainterfacewriter.vala,
if (e.static_type == null) {
/* return on previous error */
return;
- } else if (e.static_type.data_type != int_type.data_type) {
+ } else if (!(e.static_type.data_type is Struct) || !((Struct) e.static_type.data_type).is_integer_type ()) {
expr.error = true;
- Report.error (e.source_reference, "Expected expression of type ´int'");
+ Report.error (e.source_reference, "Expression of integer type expected");
}
}
}
/* check if the index is of type integer */
- if (e.static_type.data_type != int_type.data_type && e.static_type.data_type != uint_type.data_type) {
+ if (!(e.static_type.data_type is Struct) || !((Struct) e.static_type.data_type).is_integer_type ()) {
expr.error = true;
- Report.error (e.source_reference, "Expression of type `int' or `uint` expected");
+ Report.error (e.source_reference, "Expression of integer type expected");
}
}
}