[vala] Consider negative literals constant
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Consider negative literals constant
- Date: Fri, 8 Jan 2010 21:09:56 +0000 (UTC)
commit 11764759cbec71a1f07bb65e85f27e18a2c2770c
Author: Jürg Billeter <j bitron ch>
Date: Fri Jan 8 22:07:56 2010 +0100
Consider negative literals constant
Fixes bug 605158.
vala/valaunaryexpression.vala | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala
index b2066a3..f5b99e4 100644
--- a/vala/valaunaryexpression.vala
+++ b/vala/valaunaryexpression.vala
@@ -1,6 +1,6 @@
/* valaunaryexpression.vala
*
- * Copyright (C) 2006-2009 Jürg Billeter
+ * Copyright (C) 2006-2010 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
@@ -96,6 +96,14 @@ public class Vala.UnaryExpression : Expression {
return get_operator_string () + _inner.to_string ();
}
+ public override bool is_constant () {
+ if (operator == UnaryOperator.INCREMENT || operator == UnaryOperator.DECREMENT) {
+ return false;
+ }
+
+ return inner.is_constant ();
+ }
+
public override bool is_pure () {
if (operator == UnaryOperator.INCREMENT || operator == UnaryOperator.DECREMENT) {
return false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]