if (e.value_type == null) {
/* return on previous error */
return false;
- } else if (!e.value_type.compatible (analyzer.uint64_type)) {
+ } else if (!(e.value_type is IntegerType)) {
error = true;
Report.error (e.source_reference, "Expression of integer type expected");
}
}
/* check if the index is of type integer */
- if (!e.value_type.compatible (analyzer.uint64_type)) {
+ if (!(e.value_type is IntegerType)) {
error = true;
Report.error (e.source_reference, "Expression of integer type expected");
}
public DataType ulong_type;
public DataType size_t_type;
public DataType ssize_t_type;
- public DataType uint64_type;
public DataType int8_type;
public DataType unichar_type;
public DataType double_type;
ulong_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ulong"));
size_t_type = new IntegerType ((Struct) root_symbol.scope.lookup ("size_t"));
ssize_t_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ssize_t"));
- uint64_type = new IntegerType ((Struct) root_symbol.scope.lookup ("uint64"));
int8_type = new IntegerType ((Struct) root_symbol.scope.lookup ("int8"));
unichar_type = new IntegerType ((Struct) root_symbol.scope.lookup ("unichar"));
double_type = new FloatingType ((Struct) root_symbol.scope.lookup ("double"));
/* valaswitchstatement.vala
*
- * Copyright (C) 2006-2007 Jürg Billeter
+ * Copyright (C) 2006-2009 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
return false;
}
- if (!expression.value_type.compatible (analyzer.uint64_type)
+ if (!(expression.value_type is IntegerType)
+ && !(expression.value_type is EnumValueType)
&& !expression.value_type.compatible (analyzer.string_type)) {
Report.error (expression.source_reference, "Integer or string expression expected");
error = true;