summaryrefslogtreecommitdiff
path: root/vala/valabinaryexpression.vala
diff options
context:
space:
mode:
authorSimon Werbeck <simon.werbeck@gmail.com>2014-06-29 17:00:37 +0200
committerLuca Bruno <luca.bruno@immobiliare.it>2014-06-30 15:40:56 +0200
commit61d372c3d65f7830a17ac8aa34b1eb2269b311a7 (patch)
tree00b12f3361806c5af8568794b422ef7565012204 /vala/valabinaryexpression.vala
parent3f777384ca8dee53605dff49bc4136b8c5c2e0e8 (diff)
downloadvala-61d372c3d65f7830a17ac8aa34b1eb2269b311a7.tar.gz
Fix comparison of nullable value types
Fixes bug 678791
Diffstat (limited to 'vala/valabinaryexpression.vala')
-rw-r--r--vala/valabinaryexpression.vala12
1 files changed, 6 insertions, 6 deletions
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index bdd9e5eb2..98b2e5eb6 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -422,12 +422,12 @@ public class Vala.BinaryExpression : Expression {
right.target_type.value_owned = false;
if (left.value_type.nullable != right.value_type.nullable) {
- // if only one operand is nullable, make sure the other operand is promoted to nullable as well
- if (!left.value_type.nullable) {
- left.target_type.nullable = true;
- } else if (!right.value_type.nullable) {
- right.target_type.nullable = true;
- }
+ // if only one operand is nullable, make sure the other
+ // operand is promoted to nullable as well,
+ // reassign both, as get_arithmetic_result_type doesn't
+ // take nullability into account
+ left.target_type.nullable = true;
+ right.target_type.nullable = true;
}
value_type = context.analyzer.bool_type;