GNOME Bugzilla – Bug 585063
[PATCH] Implicit Value cast for binary expressions?
Last modified: 2010-01-07 20:38:47 UTC
The following vala code produces invalid C, without error from Vala. test.vala.c:29: error: invalid operands to binary == (have ‘GValue’ and ‘int’) static void main () { Value? v = Value (typeof(int)); v.set_int (1); if (v == 2) { debug ("yep"); } } And also this one produce another invalid C code. static Value? get_value (Value ?v) { return v; } static void main () { Value? v = Value (typeof(int)); v.set_int (1); if (get_value (v) == 2) { debug ("yep"); } }
forget the second case, that's not a big issue, it's something with constness.
Created attachment 146568 [details] [review] first patch
Created attachment 146569 [details] [review] following patch
commit 4b6fdd0041702c5f8e7ccb62127ac707ff2d0acb Author: Marc-André Lureau <marcandre.lureau@gmail.com> Date: Thu Jan 7 21:08:41 2010 +0100 GValue: Move explicit cast support to separate function
commit 58b40d21e3eb9d52199d6e74a64b34410afdec76 Author: Marc-André Lureau <marcandre.lureau@gmail.com> Date: Thu Jan 7 21:35:10 2010 +0100 GValue: Support implicit cast in equality check Fixes bug 585063.