[vala] Support bitwise complement with enums



commit e16901098bdb021e4f62852babdd47c35e0d88c0
Author: Jürg Billeter <j bitron ch>
Date:   Sat Jan 9 12:27:53 2010 +0100

    Support bitwise complement with enums
    
    Fixes bug 597542.

 vala/valaunaryexpression.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala
index f5b99e4..a171c8e 100644
--- a/vala/valaunaryexpression.vala
+++ b/vala/valaunaryexpression.vala
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]