2008-11-17 Jürg Billeter <j@bitron.ch>
* vala/valaarraycreationexpression.vala:
* vala/valaelementaccess.vala:
* vala/valasourcefile.vala:
Allow any integer compatible value to be used as array index,
fixes bug 561057
svn path=/trunk/; revision=2029
+2008-11-17 Jürg Billeter <j@bitron.ch>
+
+ * vala/valaarraycreationexpression.vala:
+ * vala/valaelementaccess.vala:
+ * vala/valasourcefile.vala:
+
+ Allow any integer compatible value to be used as array index,
+ fixes bug 561057
+
2008-11-17 Jürg Billeter <j@bitron.ch>
* vala/valaflowanalyzer.vala:
if (e.value_type == null) {
/* return on previous error */
return false;
- } else if (!(e.value_type.data_type is Struct) || !((Struct) e.value_type.data_type).is_integer_type ()) {
+ } else if (!e.value_type.compatible (analyzer.long_type)) {
error = true;
Report.error (e.source_reference, "Expression of integer type expected");
}
}
/* check if the index is of type integer */
- if (!(e.value_type.data_type is Struct) || !((Struct) e.value_type.data_type).is_integer_type ()) {
+ if (!e.value_type.compatible (analyzer.long_type)) {
error = true;
Report.error (e.source_reference, "Expression of integer type expected");
}
{
source_array = new Gee.ArrayList<string> ();
string[] lines = cont.split ("\n", 0);
- uint idx;
+ int idx;
for (idx = 0; lines[idx] != null; ++idx) {
source_array.add (lines[idx]);
}