summaryrefslogtreecommitdiff
path: root/vala/valaswitchstatement.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2009-05-05 23:21:30 +0200
committerJürg Billeter <j@bitron.ch>2009-05-05 23:24:51 +0200
commit9a509bce2e652fe085cba8fa5d5598394e2187c6 (patch)
tree3d8198afbae98ade7e743708c3bc37935b44a9b9 /vala/valaswitchstatement.vala
parent744e341fd2bad78e87b76b303f03599586f31f56 (diff)
downloadvala-9a509bce2e652fe085cba8fa5d5598394e2187c6.tar.gz
Do not depend on uint64 in semantic analyzer
Diffstat (limited to 'vala/valaswitchstatement.vala')
-rw-r--r--vala/valaswitchstatement.vala5
1 files changed, 3 insertions, 2 deletions
diff --git a/vala/valaswitchstatement.vala b/vala/valaswitchstatement.vala
index 0fd5b8383..a66a284b7 100644
--- a/vala/valaswitchstatement.vala
+++ b/vala/valaswitchstatement.vala
@@ -1,6 +1,6 @@
/* 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
@@ -106,7 +106,8 @@ public class Vala.SwitchStatement : CodeNode, Statement {
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;