GNOME Bugzilla – Bug 779219
Wrong c-cast-type in getter-call for non-writeable abstract properties
Last modified: 2017-03-11 15:47:28 UTC
Once you use Gee, is expected a set of warning at C compilation phase. Use this code: using Gee; public class Empl : Object { public string name { get; set; } } public interface Col : GLib.Object, Gee.BidirList<Empl> { public abstract int length { get; } } public class MyHash : Gee.ArrayList<Empl>, Col { public int length { get { return size; } } } static void main () { var m = new MyHash (); var e = new Empl (); e.name = "Soe"; m.add (e); } You will get: gee-collections.vala.c: In function ‘my_hash_real_get_length’: /home/despinosa/Proyectos/Tests/vala/gee-collections.vala.c:248:45: warning: passing argument 1 of ‘gee_abstract_collection_get_size’ from incompatible pointer type [-Wincompatible-pointer-types] _tmp0_ = gee_abstract_collection_get_size ((GeeCollection*) self); ^ In file included from gee-collections.vala.c:9:0: jhbuild/install/include/gee-0.8/gee.h:1452:6: note: expected ‘GeeAbstractCollection * {aka struct _GeeAbstractCollection *}’ but argument is of type ‘GeeCollection * {aka struct _GeeCollection *}’ gint gee_abstract_collection_get_size (GeeAbstractCollection* self);
Created attachment 346829 [details] Test Case
Created attachment 346894 [details] [review] codegen: Implicitly cast instance arg to match used property get-accessor
Created attachment 347267 [details] [review] memberaccess: Don't resolve base_method/property twice
Attachment 347267 [details] pushed as 540154b - memberaccess: Don't resolve base_method/property twice
*** Bug 710865 has been marked as a duplicate of this bug. ***