Erroneous c code generated when accessing HashTable constructor as a base constructor
Submitted by Andreas Obergrusberger
Link to original bug (#689924)
Description
Created attachment 231059 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.
Attachment 231059, "Testcase which gives rise to the problem.":
testcase.vala