]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support bitwise complement with enums
authorJürg Billeter <j@bitron.ch>
Sat, 9 Jan 2010 11:27:53 +0000 (12:27 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 9 Jan 2010 11:27:53 +0000 (12:27 +0100)
Fixes bug 597542.

vala/valaunaryexpression.vala

index f5b99e499dc3b515ef65eddb719464e1342084e1..a171c8e7cc2e4a794567cae856b71ecca8b2a44b 100644 (file)
@@ -182,7 +182,7 @@ public class Vala.UnaryExpression : Expression {
                        value_type = inner.value_type;
                } else if (operator == UnaryOperator.BITWISE_COMPLEMENT) {
                        // integer type
-                       if (!is_integer_type (inner.value_type)) {
+                       if (!is_integer_type (inner.value_type) && !(inner.value_type is EnumValueType)) {
                                error = true;
                                Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
                                return false;