diff options
author | Simon Werbeck <simon.werbeck@gmail.com> | 2014-06-29 17:00:37 +0200 |
---|---|---|
committer | Luca Bruno <luca.bruno@immobiliare.it> | 2014-06-30 15:40:56 +0200 |
commit | 61d372c3d65f7830a17ac8aa34b1eb2269b311a7 (patch) | |
tree | 00b12f3361806c5af8568794b422ef7565012204 /vala/valabinaryexpression.vala | |
parent | 3f777384ca8dee53605dff49bc4136b8c5c2e0e8 (diff) | |
download | vala-61d372c3d65f7830a17ac8aa34b1eb2269b311a7.tar.gz |
Fix comparison of nullable value types
Fixes bug 678791
Diffstat (limited to 'vala/valabinaryexpression.vala')
-rw-r--r-- | vala/valabinaryexpression.vala | 12 |
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; |