GNOME Bugzilla – Bug 689924
Erroneous c code generated when accessing HashTable constructor as a base constructor
Last modified: 2018-05-22 14:38:07 UTC
Created attachment 231059 [details] Testcase which gives rise to the problem. Dear hard-working vala developers :) When deriving a class from HashTable and accessing its base constructor (i.e. the constructor of HashTable) using base(str_hash, str_equal); valac generates this bad c code (where "Derived" is the name of the class derived from HashTable): self = (Derived*) g_hash_table_new_full (_tmp0_, _tmp1_); But g_hash_table_new_full requires two more parameters. Constructing a HashTable using HashTable table = new HashTable<string, string> (str_hash, str_equal); works. So does accessing the base constructor by writing base.full(str_hash, str_equal, null, null); I attached a testcase for this.
While possible,Vala have much better support of GObject derived classes, then this issues will produce extrange C code generation behavior. Developer should be encouraged to use GObject derived classes. If good support is wanted, then use them to wrap up non GObject types. So this bug could be set to enhancement and tagged for 1.2 milestone.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/342.