ArrayList.contains doesn't correct work with structure
Submitted by als..@..dex.ru
Link to original bug (#756826)
Description
using Gee;
public struct Point { public int x; public int y; }
void main() { var near = new ArrayList<Point?>(); near.add(Point() {x = 0, y = 6}); stdout.printf(@"$(near.contains(Point() {x = 0, y = 6}))\n"); }
$ valac 1.vala --pkg gee-1.0 && ./1 /home/alsoijw/1.vala.c: In function ‘_vala_main’: /home/alsoijw/1.vala.c:82:71: warning: passing argument 3 of ‘gee_array_list_new’ from incompatible pointer type tmp0 = gee_array_list_new (TYPE_POINT, (GBoxedCopyFunc) point_dup, point_free, NULL); ^ In file included from /home/alsoijw/1.vala.c:8:0: /usr/include/gee-1.0/gee.h:819:15: note: expected ‘GDestroyNotify’ but argument is of type ‘void (*)(struct Point )’ GeeArrayList gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GEqualFunc equal_func); ^ false
or
$ valac 1.vala --pkg gee-0.8 && ./1 /home/alsoijw/1.vala.c: In function ‘_vala_main’: /home/alsoijw/1.vala.c:84:71: warning: passing argument 3 of ‘gee_array_list_new’ from incompatible pointer type tmp0 = gee_array_list_new (TYPE_POINT, (GBoxedCopyFunc) point_dup, point_free, NULL, NULL, NULL); ^ In file included from /home/alsoijw/1.vala.c:8:0: /usr/include/gee-0.8/gee.h:1520:15: note: expected ‘GDestroyNotify’ but argument is of type ‘void ()(struct Point )’ GeeArrayList gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void equal_func_target, GDestroyNotify equal_func_target_destroy_notify); ^ false
It must write 'true' because struct are compared by value.
Version: git master