]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not depend on uint64 in semantic analyzer
authorJürg Billeter <j@bitron.ch>
Tue, 5 May 2009 21:21:30 +0000 (23:21 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 5 May 2009 21:24:51 +0000 (23:24 +0200)
vala/valaarraycreationexpression.vala
vala/valaelementaccess.vala
vala/valasemanticanalyzer.vala
vala/valaswitchstatement.vala

index 6ed9d0c38212a7b252b70403afceb9c7a0775858..8b8049c4fa09cd2afdae19da5a187b1307c6643e 100644 (file)
@@ -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.compatible (analyzer.uint64_type)) {
+                               } else if (!(e.value_type is IntegerType)) {
                                        error = true;
                                        Report.error (e.source_reference, "Expression of integer type expected");
                                }
index b651686686b4d52a9b396fc9a421cf96f7dcbaa4..2097efa18ff5aeb9c13ab849a8aaa54302bf3b1f 100644 (file)
@@ -187,7 +187,7 @@ public class Vala.ElementAccess : Expression {
                                }
 
                                /* 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");
                                }
index 3655916e7a00d134670cfb178ef18d81b6993f09..45de1a9b6fbf5a2c2596255e8b158b7fec9a011b 100644 (file)
@@ -51,7 +51,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
        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;
@@ -93,7 +92,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                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"));
index 0fd5b838332a0f4cef92df92f8dd71158f121206..a66a284b724eead484870a7d21741b9b22bbad5a 100644 (file)
@@ -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;